Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Script3 = Instance.new("Script")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Part6 = Instance.new("Part")
- Humanoid7 = Instance.new("Humanoid")
- Part8 = Instance.new("Part")
- Motor6D9 = Instance.new("Motor6D")
- Script10 = Instance.new("Script")
- Part11 = Instance.new("Part")
- Motor6D12 = Instance.new("Motor6D")
- Motor6D13 = Instance.new("Motor6D")
- Motor6D14 = Instance.new("Motor6D")
- Motor6D15 = Instance.new("Motor6D")
- Motor6D16 = Instance.new("Motor6D")
- Script17 = Instance.new("Script")
- Folder18 = Instance.new("Folder")
- Animation19 = Instance.new("Animation")
- NumberValue20 = Instance.new("NumberValue")
- Animation21 = Instance.new("Animation")
- NumberValue22 = Instance.new("NumberValue")
- Animation23 = Instance.new("Animation")
- NumberValue24 = Instance.new("NumberValue")
- Folder25 = Instance.new("Folder")
- Animation26 = Instance.new("Animation")
- Animation27 = Instance.new("Animation")
- ParticleEmitter28 = Instance.new("ParticleEmitter")
- Script29 = Instance.new("Script")
- ParticleEmitter30 = Instance.new("ParticleEmitter")
- Sound31 = Instance.new("Sound")
- Script32 = Instance.new("Script")
- BillboardGui33 = Instance.new("BillboardGui")
- ImageLabel34 = Instance.new("ImageLabel")
- Script35 = Instance.new("Script")
- BillboardGui36 = Instance.new("BillboardGui")
- ImageLabel37 = Instance.new("ImageLabel")
- Part38 = Instance.new("Part")
- Script39 = Instance.new("Script")
- StringValue40 = Instance.new("StringValue")
- Animation41 = Instance.new("Animation")
- StringValue42 = Instance.new("StringValue")
- Animation43 = Instance.new("Animation")
- StringValue44 = Instance.new("StringValue")
- Animation45 = Instance.new("Animation")
- NumberValue46 = Instance.new("NumberValue")
- Animation47 = Instance.new("Animation")
- NumberValue48 = Instance.new("NumberValue")
- StringValue49 = Instance.new("StringValue")
- Animation50 = Instance.new("Animation")
- StringValue51 = Instance.new("StringValue")
- Animation52 = Instance.new("Animation")
- StringValue53 = Instance.new("StringValue")
- Animation54 = Instance.new("Animation")
- StringValue55 = Instance.new("StringValue")
- Animation56 = Instance.new("Animation")
- StringValue57 = Instance.new("StringValue")
- Animation58 = Instance.new("Animation")
- Script59 = Instance.new("Script")
- Folder60 = Instance.new("Folder")
- Animation61 = Instance.new("Animation")
- NumberValue62 = Instance.new("NumberValue")
- Animation63 = Instance.new("Animation")
- NumberValue64 = Instance.new("NumberValue")
- Animation65 = Instance.new("Animation")
- NumberValue66 = Instance.new("NumberValue")
- Folder67 = Instance.new("Folder")
- Animation68 = Instance.new("Animation")
- Animation69 = Instance.new("Animation")
- Animation70 = Instance.new("Animation")
- Animation71 = Instance.new("Animation")
- Animation72 = Instance.new("Animation")
- ParticleEmitter73 = Instance.new("ParticleEmitter")
- Script74 = Instance.new("Script")
- Sound75 = Instance.new("Sound")
- Sound76 = Instance.new("Sound")
- Script77 = Instance.new("Script")
- Sound78 = Instance.new("Sound")
- Script79 = Instance.new("Script")
- ParticleEmitter80 = Instance.new("ParticleEmitter")
- Sound81 = Instance.new("Sound")
- Shirt82 = Instance.new("Shirt")
- Pants83 = Instance.new("Pants")
- Script84 = Instance.new("Script")
- Camera85 = Instance.new("Camera")
- BodyColors86 = Instance.new("BodyColors")
- BodyColors87 = Instance.new("BodyColors")
- Model0.Name = "fight me"
- Model0.Parent = mas
- Part1.Name = "Head"
- Part1.Parent = Model0
- Part1.CFrame = CFrame.new(-243.66864, 5.31002808, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part1.Orientation = Vector3.new(0, 180, 0)
- Part1.Position = Vector3.new(-243.66864, 5.31002808, 45.1103287)
- Part1.Rotation = Vector3.new(-180, 0, -180)
- Part1.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part1.Size = Vector3.new(2.3599999, 1.17999995, 1.17999995)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Light orange")
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Light orange")
- Part1.FormFactor = Enum.FormFactor.Symmetric
- Part1.formFactor = Enum.FormFactor.Symmetric
- SpecialMesh2.Parent = Part1
- SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
- Script3.Name = "qPerfectionWeld"
- Script3.Parent = Part1
- table.insert(cors,sandbox(Script3,function()
- -- Created by Quenty (@Quenty, follow me on twitter).
- -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
- -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
- --[[ INSTRUCTIONS
- - Place in the model
- - Make sure model is anchored
- - That's it. It will weld the model and all children.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
- This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
- ]]
- --[[ DOCUMENTATION
- - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
- - Will work in PBS servers
- - Will work as long as it starts out with the part anchored
- - Stores the relative CFrame as a CFrame value
- - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
- - Utilizes a recursive algorith to find all parts in the model
- - Will reweld on script reparent if the script is initially parented to a tool.
- - Welds as fast as possible
- ]]
- -- qPerfectionWeld.lua
- -- Created 10/6/2014
- -- Author: Quenty
- -- Version 1.0.3
- -- Updated 10/14/2014 - Updated to 1.0.1
- --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
- -- Updated 10/14/2014 - Updated to 1.0.2
- --- Fixed bug fix.
- -- Updated 10/14/2014 - Updated to 1.0.3
- --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
- local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
- local function CallOnChildren(Instance, FunctionToCall)
- -- Calls a function on each of the children of a certain object, using recursion.
- FunctionToCall(Instance)
- for _, Child in next, Instance:GetChildren() do
- CallOnChildren(Child, FunctionToCall)
- end
- end
- local function GetNearestParent(Instance, ClassName)
- -- Returns the nearest parent of a certain class, or returns nil
- local Ancestor = Instance
- repeat
- Ancestor = Ancestor.Parent
- if Ancestor == nil then
- return nil
- end
- until Ancestor:IsA(ClassName)
- return Ancestor
- end
- local function GetBricks(StartInstance)
- local List = {}
- -- if StartInstance:IsA("BasePart") then
- -- List[#List+1] = StartInstance
- -- end
- CallOnChildren(StartInstance, function(Item)
- if Item:IsA("BasePart") then
- List[#List+1] = Item;
- end
- end)
- return List
- end
- local function Modify(Instance, Values)
- -- Modifies an Instance by using a table.
- assert(type(Values) == "table", "Values is not a table");
- for Index, Value in next, Values do
- if type(Index) == "number" then
- Value.Parent = Instance
- else
- Instance[Index] = Value
- end
- end
- return Instance
- end
- local function Make(ClassType, Properties)
- -- Using a syntax hack to create a nice way to Make new items.
- return Modify(Instance.new(ClassType), Properties)
- end
- local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
- local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
- local function HasWheelJoint(Part)
- for _, SurfaceName in pairs(Surfaces) do
- for _, HingSurfaceName in pairs(HingSurfaces) do
- if Part[SurfaceName].Name == HingSurfaceName then
- return true
- end
- end
- end
- return false
- end
- local function ShouldBreakJoints(Part)
- --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
- -- definitely some edge cases.
- if NEVER_BREAK_JOINTS then
- return false
- end
- if HasWheelJoint(Part) then
- return false
- end
- local Connected = Part:GetConnectedParts()
- if #Connected == 1 then
- return false
- end
- for _, Item in pairs(Connected) do
- if HasWheelJoint(Item) then
- return false
- elseif not Item:IsDescendantOf(script.Parent) then
- return false
- end
- end
- return true
- end
- local function WeldTogether(Part0, Part1, JointType, WeldParent)
- --- Weld's 2 parts together
- -- @param Part0 The first part
- -- @param Part1 The second part (Dependent part most of the time).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
- -- @return The weld created.
- JointType = JointType or "Weld"
- local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
- local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
- Modify(NewWeld, {
- Name = "qCFrameWeldThingy";
- Part0 = Part0;
- Part1 = Part1;
- C0 = CFrame.new();--Part0.CFrame:inverse();
- C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
- Parent = Part1;
- })
- if not RelativeValue then
- RelativeValue = Make("CFrameValue", {
- Parent = Part1;
- Name = "qRelativeCFrameWeldValue";
- Archivable = true;
- Value = NewWeld.C1;
- })
- end
- return NewWeld
- end
- local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
- -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
- -- @param MainPart The part to weld the model to (can be in the model).
- -- @param [JointType] The type of joint. Defaults to weld.
- -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
- for _, Part in pairs(Parts) do
- if ShouldBreakJoints(Part) then
- Part:BreakJoints()
- end
- end
- for _, Part in pairs(Parts) do
- if Part ~= MainPart then
- WeldTogether(MainPart, Part, JointType, MainPart)
- end
- end
- if not DoNotUnanchor then
- for _, Part in pairs(Parts) do
- Part.Anchored = false
- end
- MainPart.Anchored = false
- end
- end
- local function PerfectionWeld()
- local Tool = GetNearestParent(script, "Tool")
- local Parts = GetBricks(script.Parent)
- local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
- if PrimaryPart then
- WeldParts(Parts, PrimaryPart, "Weld", false)
- else
- warn("qWeld - Unable to weld part")
- end
- return Tool
- end
- local Tool = PerfectionWeld()
- if Tool and script.ClassName == "Script" then
- --- Don't bother with local scripts
- script.Parent.AncestryChanged:connect(function()
- PerfectionWeld()
- end)
- end
- -- Created by Quenty (@Quenty, follow me on twitter).
- end))
- Part4.Name = "Left Leg"
- Part4.Parent = Model0
- Part4.CFrame = CFrame.new(-243.078644, 1.1800282, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part4.Orientation = Vector3.new(0, 180, 0)
- Part4.Position = Vector3.new(-243.078644, 1.1800282, 45.1103287)
- Part4.Rotation = Vector3.new(-180, 0, -180)
- Part4.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part4.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.BrickColor = BrickColor.new("Light orange")
- Part4.CanCollide = false
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.brickColor = BrickColor.new("Light orange")
- Part4.FormFactor = Enum.FormFactor.Symmetric
- Part4.formFactor = Enum.FormFactor.Symmetric
- Part5.Name = "Right Arm"
- Part5.Parent = Model0
- Part5.CFrame = CFrame.new(-245.438644, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part5.Orientation = Vector3.new(0, 180, 0)
- Part5.Position = Vector3.new(-245.438644, 3.5400281, 45.1103287)
- Part5.Rotation = Vector3.new(-180, 0, -180)
- Part5.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part5.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.BrickColor = BrickColor.new("Light orange")
- Part5.CanCollide = false
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.brickColor = BrickColor.new("Light orange")
- Part5.FormFactor = Enum.FormFactor.Symmetric
- Part5.formFactor = Enum.FormFactor.Symmetric
- Part6.Name = "Right Leg"
- Part6.Parent = Model0
- Part6.CFrame = CFrame.new(-244.258636, 1.1800282, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part6.Orientation = Vector3.new(0, 180, 0)
- Part6.Position = Vector3.new(-244.258636, 1.1800282, 45.1103287)
- Part6.Rotation = Vector3.new(-180, 0, -180)
- Part6.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part6.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.BrickColor = BrickColor.new("Light orange")
- Part6.CanCollide = false
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.brickColor = BrickColor.new("Light orange")
- Part6.FormFactor = Enum.FormFactor.Symmetric
- Part6.formFactor = Enum.FormFactor.Symmetric
- Humanoid7.Parent = Model0
- Humanoid7.Health = inf
- Humanoid7.LeftLeg = Part4
- Humanoid7.MaxHealth = inf
- Humanoid7.NameOcclusion = Enum.NameOcclusion.NoOcclusion
- Humanoid7.RightLeg = Part6
- Humanoid7.Torso = Part8
- Humanoid7.WalkSpeed = 20
- Humanoid7.maxHealth = inf
- Part8.Name = "HumanoidRootPart"
- Part8.Parent = Model0
- Part8.CFrame = CFrame.new(-243.66864, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part8.Orientation = Vector3.new(0, 180, 0)
- Part8.Position = Vector3.new(-243.66864, 3.5400281, 45.1103287)
- Part8.Rotation = Vector3.new(-180, 0, -180)
- Part8.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part8.Transparency = 1
- Part8.Size = Vector3.new(2.3599999, 2.3599999, 1.17999995)
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.BrickColor = BrickColor.new("Institutional white")
- Part8.CanCollide = false
- Part8.LeftParamA = 0
- Part8.LeftParamB = 0
- Part8.RightParamA = 0
- Part8.RightParamB = 0
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.brickColor = BrickColor.new("Institutional white")
- Part8.FormFactor = Enum.FormFactor.Symmetric
- Part8.formFactor = Enum.FormFactor.Symmetric
- Motor6D9.Name = "RootJoint"
- Motor6D9.Parent = Part8
- Motor6D9.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D9.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D9.Part0 = Part8
- Motor6D9.Part1 = Part11
- Motor6D9.part1 = Part11
- Script10.Name = "Respawn"
- Script10.Parent = Model0
- table.insert(cors,sandbox(Script10,function()
- local humname = "Humanoid"
- local npc = script.Parent
- local home = npc.Parent
- local clone = npc:Clone()
- while true do
- wait(5)
- if npc and npc.Parent and home then
- if npc:FindFirstChild(humname).Health < 1 then
- wait(5)
- local robot = clone:Clone()
- robot.Parent = home
- robot:MakeJoints()
- npc:Destroy()
- script.Disabled = true
- end
- end
- end
- end))
- Part11.Name = "Torso"
- Part11.Parent = Model0
- Part11.CFrame = CFrame.new(-243.66864, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part11.Orientation = Vector3.new(0, 180, 0)
- Part11.Position = Vector3.new(-243.66864, 3.5400281, 45.1103287)
- Part11.Rotation = Vector3.new(-180, 0, -180)
- Part11.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part11.Size = Vector3.new(2.3599999, 2.3599999, 1.17999995)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.BrickColor = BrickColor.new("Light orange")
- Part11.LeftParamA = 0
- Part11.LeftParamB = 0
- Part11.RightParamA = 0
- Part11.RightParamB = 0
- Part11.TopSurface = Enum.SurfaceType.Smooth
- Part11.brickColor = BrickColor.new("Light orange")
- Part11.FormFactor = Enum.FormFactor.Symmetric
- Part11.formFactor = Enum.FormFactor.Symmetric
- Motor6D12.Name = "Right Shoulder"
- Motor6D12.Parent = Part11
- Motor6D12.C0 = CFrame.new(1.17999995, 0.589999974, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D12.C1 = CFrame.new(-0.589999974, 0.589999974, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D12.Part0 = Part11
- Motor6D12.Part1 = Part5
- Motor6D12.part1 = Part5
- Motor6D13.Name = "Right Hip"
- Motor6D13.Parent = Part11
- Motor6D13.C0 = CFrame.new(1.17999995, -1.17999995, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D13.C1 = CFrame.new(0.589999974, 1.17999995, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D13.Part0 = Part11
- Motor6D13.Part1 = Part6
- Motor6D13.part1 = Part6
- Motor6D14.Name = "Left Hip"
- Motor6D14.Parent = Part11
- Motor6D14.C0 = CFrame.new(-1.17999995, -1.17999995, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D14.C1 = CFrame.new(-0.589999974, 1.17999995, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D14.Part0 = Part11
- Motor6D14.Part1 = Part4
- Motor6D14.part1 = Part4
- Motor6D15.Name = "Neck"
- Motor6D15.Parent = Part11
- Motor6D15.C0 = CFrame.new(0, 1.17999995, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D15.C1 = CFrame.new(0, -0.589999974, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D15.Part0 = Part11
- Motor6D15.Part1 = Part1
- Motor6D15.part1 = Part1
- Motor6D16.Name = "Left Shoulder"
- Motor6D16.Parent = Part11
- Motor6D16.C0 = CFrame.new(-1.17999995, 0.589999974, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D16.C1 = CFrame.new(0.589999974, 0.589999974, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D16.Part0 = Part11
- Motor6D16.Part1 = Part38
- Motor6D16.part1 = Part38
- Script17.Name = "Old script, just delete this"
- Script17.Parent = Model0
- table.insert(cors,sandbox(Script17,function()
- wait()
- --------------------- VARIABLES ---------------------------
- local npc = script.Parent
- local torso = npc.Torso
- local hum = npc:findFirstChild("Humanoid")
- local target = npc.TargetTo
- debounce = false
- punching = false
- local SpecialMoves = {
- "ShootFireball",
- "BlastFireball",
- "SpeedBoost"
- }
- --------------------- FUNCTIONS ---------------------------
- function blastfireball()
- wait(1.2)
- --shoot fireball
- local part = Instance.new("Part")
- part.Name = "BigFireball"
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Shape = "Ball"
- part.Size = Vector3.new(3, 3, 3)
- part.BrickColor = BrickColor.new("Deep orange")
- part.CanCollide = false
- part.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire = script.FireEffect:Clone()
- fire.Enabled = true
- fire.Parent = part
- local light = Instance.new("PointLight", part)
- light.Color = Color3.new(255, 205, 0)
- light.Range = 10
- local velocity = Instance.new("BodyVelocity", part)
- velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part.Parent = game.Workspace
- part.CFrame = npc.Torso.CFrame * CFrame.new(0, 0, -5)
- local s = script.FireballDamage:clone()
- s.Disabled = false
- s.Parent = part
- local sound = script.FireballSound:clone()
- sound.Parent = part
- sound:Play()
- end
- function shootfireball()
- wait(0.6)
- local part = Instance.new("Part")
- part.Name = "Fireball"
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Shape = "Ball"
- part.Size = Vector3.new(1.5,1.5,1.5)
- part.BrickColor = BrickColor.new("Deep orange")
- part.CanCollide = false
- part.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire = script.FireEffect:Clone()
- fire.Enabled = true
- fire.Parent = part
- local light = Instance.new("PointLight", part)
- light.Color = Color3.new(255, 205, 0)
- light.Range = 8
- local s = script.FireballDamage:clone()
- s.Disabled = false
- s.Parent = part
- local sound = script.FireballSound:clone()
- sound.Parent = part
- sound:Play()
- local velocity = Instance.new("BodyVelocity", part)
- velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part.Parent = game.Workspace
- part.CFrame = npc.Torso.CFrame * CFrame.new(2, 0, 0)
- wait(0.4) -----------------------------------------------------------------
- local part = Instance.new("Part")
- part.Name = "Fireball"
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Shape = "Ball"
- part.Size = Vector3.new(1.5,1.5,1.5)
- part.BrickColor = BrickColor.new("Deep orange")
- part.CanCollide = false
- part.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire = script.FireEffect:Clone()
- fire.Enabled = true
- fire.Parent = part
- local light = Instance.new("PointLight", part)
- light.Color = Color3.new(255, 205, 0)
- light.Range = 8
- local s = script.FireballDamage:clone()
- s.Disabled = false
- s.Parent = part
- local sound = script.FireballSound:clone()
- sound.Parent = part
- sound:Play()
- local velocity = Instance.new("BodyVelocity", part)
- velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part.Parent = game.Workspace
- part.CFrame = npc.Torso.CFrame * CFrame.new(-2, 0, 0)
- end
- function speedboost()
- local part = Instance.new("Part", game.Workspace)
- part.Name = "RadiusEffect"
- part.Shape = "Ball"
- part.CanCollide = false
- part.BrickColor = BrickColor.new("White")
- part.Size = Vector3.new(3,3,3)
- part.Anchored = true
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Transparency = 0.1
- part.CFrame = npc:findFirstChild("Torso").CFrame
- game.Debris:AddItem(part, 3)
- for i = 1, 25 do --animate the ball
- part.Size = part.Size + Vector3.new(0.5,0.5,0.5)
- part.Transparency = part.Transparency + 0.04
- part.CFrame = torso.CFrame
- wait()
- end
- end
- -------------------------------- MAIN SCRIPTS ------------------------------------
- walkcount = 0
- function chase(p)
- if hum.Health > 0 then
- if p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil then
- debounce = true
- target.Value = p.Parent.Name
- for chance = 1, 20 do
- if debounce == true then --set to false if you don't want it to range attack
- walkcount = walkcount + 1
- end
- if walkcount == 10 then
- local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
- if ChosenAttack == "ShootFireball" then
- hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
- shootfireball()
- end ----------------------------
- if ChosenAttack == "BlastFireball" then
- hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
- blastfireball()
- end
- if ChosenAttack == "SpeedBoost" then
- speedboost()
- hum.WalkSpeed = 16.5 --humanoid speed
- wait(5)
- hum.WalkSpeed = 12 --original speed
- end
- end
- if punching == false then
- if p and p.Parent then
- hum:MoveTo(p.Parent.Torso.Position, p.Parent.Torso)
- end
- end
- wait(0.1)
- end
- walkcount = 0
- end
- end
- end
- function attack(p)
- if hum.Health > 0 then
- if punching == false and p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil and p.Parent:findFirstChild("Humanoid").Health > 0 then
- local victim = p.Parent
- victim.Humanoid:TakeDamage(math.random(10, 15))
- --victim.Humanoid.Sit = true
- --add velocity or something
- victim.Torso.Velocity = torso.CFrame.lookVector * 50 + Vector3.new(0, 25, 0)
- punching = true
- local attackanimations = script.AttackAnimations:GetChildren()
- local chosenAnim = attackanimations[math.random(1, #attackanimations)]
- hum:LoadAnimation(chosenAnim):Play()
- wait(1)
- punching = false
- end
- end
- end
- torso.Touched:connect(chase)
- torso.Touched:connect(attack)
- end))
- Script17.Disabled = true
- Folder18.Name = "AttackAnimations"
- Folder18.Parent = Script17
- Animation19.Name = "AttackAnim2"
- Animation19.Parent = Folder18
- Animation19.AnimationId = "rbxassetid://498292433"
- NumberValue20.Name = "CooldownTime"
- NumberValue20.Parent = Animation19
- NumberValue20.Value = 0.8
- Animation21.Name = "AttackAnim3"
- Animation21.Parent = Folder18
- Animation21.AnimationId = "rbxassetid://501476461"
- NumberValue22.Name = "CooldownTime"
- NumberValue22.Parent = Animation21
- NumberValue22.Value = 1
- Animation23.Name = "AttackAnim1"
- Animation23.Parent = Folder18
- Animation23.AnimationId = "rbxassetid://498281474"
- NumberValue24.Name = "CooldownTime"
- NumberValue24.Parent = Animation23
- NumberValue24.Value = 1
- Folder25.Name = "FireCastAnimations"
- Folder25.Parent = Script17
- Animation26.Name = "BigFireCast"
- Animation26.Parent = Folder25
- Animation26.AnimationId = "rbxassetid://498346816"
- Animation27.Name = "FireShoot"
- Animation27.Parent = Folder25
- Animation27.AnimationId = "rbxassetid://502043286"
- ParticleEmitter28.Name = "FireEffect"
- ParticleEmitter28.Parent = Script17
- ParticleEmitter28.Speed = NumberRange.new(10, 10)
- ParticleEmitter28.Color = ColorSequence.new(Color3.new(1, 0.666667, 0),Color3.new(1, 0.370819, 0),Color3.new(1, 0.333333, 0))
- ParticleEmitter28.Enabled = false
- ParticleEmitter28.LightEmission = 0.34999999403954
- ParticleEmitter28.Texture = "rbxassetid://494864527"
- ParticleEmitter28.Transparency = NumberSequence.new(0.50625002384186,0,1)
- ParticleEmitter28.Size = NumberSequence.new(0,1.0624998807907,0,0)
- ParticleEmitter28.Lifetime = NumberRange.new(0.5, 0.75)
- ParticleEmitter28.Rate = 200
- ParticleEmitter28.RotSpeed = NumberRange.new(-180, 180)
- Script29.Name = "FireballDamage"
- Script29.Parent = Script17
- table.insert(cors,sandbox(Script29,function()
- local sp = script.Parent
- function damage(p)
- if game.Players:FindFirstChild(p.Parent.Name) ~= nil then
- if p and p.Parent then
- if p.Parent.ClassName ~= "Hat" or p.Parent.ClassName ~= "Tool" then
- script.Disabled = true
- sp.Anchored = true
- sp:findFirstChild("FireEffect"):Destroy()
- sp.Transparency = 1
- sp:findFirstChild("PointLight"):Destroy()
- local fire = script.FireEffect
- fire.Parent = p.Parent.Torso
- fire.Enabled = true
- p.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(30,50))
- sp:findFirstChild("FireballSound"):clone().Parent = p.Parent.Torso
- sp:findFirstChild("FireballSound"):Destroy()
- wait(2.5)
- fire.Enabled = false
- for i = 1, 10 do
- if p and p.Parent then
- p.Parent.Torso:findFirstChild("FireballSound").Volume = p.Parent.Torso:findFirstChild("FireballSound").Volume - 0.1
- wait()
- end
- end
- wait(0.5)
- fire:Destroy()
- p.Parent.Torso:findFirstChild("FireballSound"):Destroy()
- script.Parent:Destroy()
- end
- end
- end
- wait(0.025)
- end
- script.Parent.Touched:connect(damage)
- end))
- Script29.Disabled = true
- ParticleEmitter30.Name = "FireEffect"
- ParticleEmitter30.Parent = Script29
- ParticleEmitter30.Speed = NumberRange.new(10, 10)
- ParticleEmitter30.Color = ColorSequence.new(Color3.new(1, 0.666667, 0),Color3.new(1, 0.370819, 0),Color3.new(1, 0.333333, 0))
- ParticleEmitter30.Enabled = false
- ParticleEmitter30.LightEmission = 0.34999999403954
- ParticleEmitter30.Texture = "rbxassetid://494864527"
- ParticleEmitter30.Transparency = NumberSequence.new(0.50625002384186,0,1)
- ParticleEmitter30.Size = NumberSequence.new(0,1.0624998807907,0,0)
- ParticleEmitter30.Lifetime = NumberRange.new(0.5, 0.75)
- ParticleEmitter30.Rate = 200
- ParticleEmitter30.RotSpeed = NumberRange.new(-180, 180)
- Sound31.Name = "FireballSound"
- Sound31.Parent = Script17
- Sound31.Looped = true
- Sound31.SoundId = "http://www.roblox.com/asset/?id=31760113"
- Sound31.Volume = 1
- Script32.Name = "BloodScript3"
- Script32.Parent = Model0
- table.insert(cors,sandbox(Script32,function()
- -- This script makes everytime a player dies, blood will come out --
- function died()
- local human = script.Parent:FindFirstChild("Humanoid")
- if (human.Health == 0) then
- for i = 1,50 do
- local torso = script.Parent:FindFirstChild("Torso")
- if torso ~= nil then
- local blood = Instance.new("Part")
- blood.BrickColor = BrickColor.new("Crimson")
- blood.Transparency = 1
- blood.Size = Vector3.new(1, 0.4, 1)
- blood.Position = torso.Position
- blood.Name = "Blood"
- blood.Reflectance = 0.1
- blood.Material = "SmoothPlastic"
- blood.BottomSurface = "Smooth"
- blood.TopSurface = "Smooth"
- blood.Parent = game.Workspace
- local billboard = script.BillboardGui:clone()
- billboard.Parent = blood
- local gui = script.BloodGui:clone()
- gui.Parent = billboard
- game:GetService("Debris"):AddItem(blood, 12)
- end
- end
- end
- end
- script.Parent.Humanoid.Died:connect(died)
- end))
- BillboardGui33.Parent = Script32
- BillboardGui33.Size = UDim2.new(4, 0, 2, 0)
- ImageLabel34.Name = "BloodGui"
- ImageLabel34.Parent = Script32
- ImageLabel34.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel34.BackgroundColor = BrickColor.new("Institutional white")
- ImageLabel34.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel34.BackgroundTransparency = 1
- ImageLabel34.Image = "rbxassetid://479898508"
- ImageLabel34.ImageColor3 = Color3.new(0.686275, 0, 0)
- Script35.Name = "BloodScipt4"
- Script35.Parent = Model0
- table.insert(cors,sandbox(Script35,function()
- -- This script makes everytime a player get damage, the blood will come out --
- function MakeBlood()
- local blood = Instance.new("Part")
- blood.Size = Vector3.new(1,1,1)
- blood.Name = "Blood"
- blood.Transparency = 1
- blood.BrickColor = BrickColor.new("Crimson")
- blood.CanCollide = false
- blood.BottomSurface = "Smooth"
- blood.TopSurface = "Smooth"
- blood.Material = "SmoothPlastic"
- blood.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
- local billboard = script.BillboardGui:Clone()
- billboard.Parent = blood
- local gui = script.BloodGui:Clone()
- gui.Parent = billboard
- game:GetService("Debris"):AddItem(blood, 5)
- local CC = math.random(1,2)
- --[[ if CC == 1 then
- blood.CanCollide = false
- elseif CC == 2 then
- blood.CanCollide = true
- end ]]-- IF YOU WANT YOUR BLOOD TO SOMETIME BE CANCOLLIDE TRUE, THEN REMOVE THE --[[ AND ]]--
- if script.Parent:FindFirstChild("Torso") ~= nil then
- blood.Position = script.Parent.Torso.Position
- blood.Parent = game.Workspace
- end
- end
- human = script.Parent:findFirstChild("Humanoid")
- health = human.Health
- while true do
- if human.Health < health then
- howmuch = math.random(7,20)
- health = human.Health
- for i = 1 , howmuch do
- MakeBlood()
- end
- end
- wait(0.1)
- end
- end))
- BillboardGui36.Parent = Script35
- BillboardGui36.Size = UDim2.new(2, 0, 2, 0)
- ImageLabel37.Name = "BloodGui"
- ImageLabel37.Parent = Script35
- ImageLabel37.Size = UDim2.new(1, 0, 1, 0)
- ImageLabel37.BackgroundColor = BrickColor.new("Institutional white")
- ImageLabel37.BackgroundColor3 = Color3.new(1, 1, 1)
- ImageLabel37.BackgroundTransparency = 1
- ImageLabel37.Image = "rbxassetid://479898508"
- ImageLabel37.ImageColor3 = Color3.new(0.686275, 0, 0)
- Part38.Name = "Left Arm"
- Part38.Parent = Model0
- Part38.CFrame = CFrame.new(-241.898636, 3.5400281, 45.1103287, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part38.Orientation = Vector3.new(0, 180, 0)
- Part38.Position = Vector3.new(-241.898636, 3.5400281, 45.1103287)
- Part38.Rotation = Vector3.new(-180, 0, -180)
- Part38.Color = Color3.new(0.917647, 0.721569, 0.572549)
- Part38.Size = Vector3.new(1.17999995, 2.3599999, 1.17999995)
- Part38.BottomSurface = Enum.SurfaceType.Smooth
- Part38.BrickColor = BrickColor.new("Light orange")
- Part38.CanCollide = false
- Part38.TopSurface = Enum.SurfaceType.Smooth
- Part38.brickColor = BrickColor.new("Light orange")
- Part38.FormFactor = Enum.FormFactor.Symmetric
- Part38.formFactor = Enum.FormFactor.Symmetric
- Script39.Name = "Animate"
- Script39.Parent = Model0
- table.insert(cors,sandbox(Script39,function()
- function waitForChild(parent, childName)
- local child = parent:findFirstChild(childName)
- if child then return child end
- while true do
- child = parent.ChildAdded:wait()
- if child.Name==childName then return child end
- end
- end
- local Figure = script.Parent
- local Torso = waitForChild(Figure, "Torso")
- local RightShoulder = waitForChild(Torso, "Right Shoulder")
- local LeftShoulder = waitForChild(Torso, "Left Shoulder")
- local RightHip = waitForChild(Torso, "Right Hip")
- local LeftHip = waitForChild(Torso, "Left Hip")
- local Neck = waitForChild(Torso, "Neck")
- local Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance1 = {
- { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- local dances = {"dance1", "dance2", "dance3"}
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- currentAnimInstance = nil
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- local repeatAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- switch animation
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local toolAnimInstance = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- playToolAnimation(toolAnimName, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- toolAnimInstance = anim
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- toolAnimInstance = nil
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed>0.01 then
- playAnimation("walk", 0.1, Humanoid)
- if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
- setAnimationSpeed(speed / 14.5)
- end
- pose = "Running"
- else
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed>0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- playAnimation("sit", 0.5, Humanoid)
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and tool:FindFirstChild("Handle") then
- animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimInstance = nil
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook (not nessessary)
- --[[game.Players.LocalPlayer.Chatted:connect(function(msg)
- local emote = ""
- if msg == "/e dance" then
- emote = dances[math.random(1, #dances)]
- elseif (string.sub(msg, 1, 3) == "/e ") then
- emote = string.sub(msg, 4)
- elseif (string.sub(msg, 1, 7) == "/emote ") then
- emote = string.sub(msg, 8)
- end
- if (pose == "Standing" and emoteNames[emote] ~= nil) then
- playAnimation(emote, 0.1, Humanoid)
- end
- end)]]--
- -- main program
- local runService = game:service("RunService");
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue40.Name = "climb"
- StringValue40.Parent = Script39
- Animation41.Name = "ClimbAnim"
- Animation41.Parent = StringValue40
- Animation41.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- StringValue42.Name = "fall"
- StringValue42.Parent = Script39
- Animation43.Name = "FallAnim"
- Animation43.Parent = StringValue42
- Animation43.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- StringValue44.Name = "idle"
- StringValue44.Parent = Script39
- Animation45.Name = "Animation1"
- Animation45.Parent = StringValue44
- Animation45.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- NumberValue46.Name = "Weight"
- NumberValue46.Parent = Animation45
- NumberValue46.Value = 9
- Animation47.Name = "Animation2"
- Animation47.Parent = StringValue44
- Animation47.AnimationId = "http://www.roblox.com/asset/?id=180435792"
- NumberValue48.Name = "Weight"
- NumberValue48.Parent = Animation47
- NumberValue48.Value = 1
- StringValue49.Name = "jump"
- StringValue49.Parent = Script39
- Animation50.Name = "JumpAnim"
- Animation50.Parent = StringValue49
- Animation50.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue51.Name = "run"
- StringValue51.Parent = Script39
- Animation52.Name = "RunAnim"
- Animation52.Parent = StringValue51
- Animation52.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- StringValue53.Name = "sit"
- StringValue53.Parent = Script39
- Animation54.Name = "SitAnim"
- Animation54.Parent = StringValue53
- Animation54.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- StringValue55.Name = "toolnone"
- StringValue55.Parent = Script39
- Animation56.Name = "ToolNoneAnim"
- Animation56.Parent = StringValue55
- Animation56.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- StringValue57.Name = "walk"
- StringValue57.Parent = Script39
- Animation58.Name = "WalkAnim"
- Animation58.Parent = StringValue57
- Animation58.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- Script59.Name = "BattleNPC (NEW)"
- Script59.Parent = Model0
- table.insert(cors,sandbox(Script59,function()
- wait(1)
- --------------------- VARIABLES ---------------------------
- local npc = script.Parent
- local torso = npc.Torso
- local hum = npc:findFirstChild("Humanoid")
- local humrootpart = npc.HumanoidRootPart
- local target = npc.TargetTo
- local debounce = false
- local punching = false
- --local walkcount = 0
- local SpecialMoves = {
- "ShootFireball",
- "BlastFireball",
- "SpeedBoost",
- "Shockwave",
- "Fly",
- "Abyss Power"
- }
- --------------------- FUNCTIONS ---------------------------
- local larm = script.Parent:FindFirstChild("Left Arm")
- local rarm = script.Parent:FindFirstChild("Right Arm")
- function findNearestTorso(pos)
- local list = game.Workspace:children()
- local torso = nil
- local dist = 100 -- distance to find a humanoid (player)
- local temp = nil
- local human = nil
- local temp2 = nil
- for x = 1, #list do
- temp2 = list[x]
- if (temp2.className == "Model") and (temp2 ~= script.Parent) then
- temp = temp2:findFirstChild("Torso")
- human = temp2:findFirstChild("Humanoid")
- if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
- if (temp.Position - pos.Position).magnitude < dist then
- torso = temp
- dist = (temp.Position - pos.Position).magnitude
- end
- end
- end
- end
- return torso
- end
- function shootfireball()
- local debounce = false
- wait(0.6)
- local part = Instance.new("Part")
- part.Name = "Fireball"
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Shape = "Ball"
- part.Size = Vector3.new(2,2,2)
- part.BrickColor = BrickColor.new("Neon orange")
- part.CanCollide = false
- part.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire = script.FireEffect:Clone()
- fire.Enabled = true
- fire.Parent = part
- local light = Instance.new("PointLight", part)
- light.Color = Color3.new(255, 205, 0)
- light.Range = 8
- local sound = script.FireballSound:Clone()
- sound.Parent = part
- sound:Play()
- local velocity = Instance.new("BodyVelocity", part)
- velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part.Parent = game.Workspace
- part.CFrame = npc.Torso.CFrame * CFrame.new(2, 0, 0)
- local damagescript = script.FireballDamage:Clone()
- damagescript.Parent = part
- damagescript.Disabled = false
- local tag = Instance.new("ObjectValue", part)
- tag.Name = "creator"
- tag.Value = npc
- part.Parent = game.Workspace
- wait(0.4) -----------------------------------------------------------------
- local part2 = Instance.new("Part")
- part2.Name = "Fireball"
- part2.TopSurface = "Smooth"
- part2.BottomSurface = "Smooth"
- part2.Shape = "Ball"
- part2.Size = Vector3.new(2,2,2)
- part2.BrickColor = BrickColor.new("Neon orange")
- part2.CanCollide = false
- part2.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire2 = script.FireEffect:Clone()
- fire2.Enabled = true
- fire2.Parent = part2
- local light2 = Instance.new("PointLight", part2)
- light2.Color = Color3.new(255, 205, 0)
- light2.Range = 8
- local sound2 = script.FireballSound:Clone()
- sound2.Parent = part2
- sound2:Play()
- local velocity2 = Instance.new("BodyVelocity", part2)
- velocity2.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity2.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part2.CFrame = npc.Torso.CFrame * CFrame.new(-2, 0, 0)
- local damagescript2 = script.FireballDamage:Clone()
- damagescript2.Parent = part2
- damagescript2.Disabled = false
- local tag2 = Instance.new("ObjectValue", part2)
- tag2.Name = "creator"
- tag2.Value = npc
- part2.Parent = game.Workspace
- end
- function blastfireball()
- local debounce = false
- wait(1.2)
- --shoot fireball
- local part = Instance.new("Part")
- part.Name = "BigFireball"
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Shape = "Ball"
- part.Size = Vector3.new(3.5, 3.5, 3.5)
- part.BrickColor = BrickColor.new("Neon orange")
- part.CanCollide = false
- part.Transparency = 0.3
- game.Debris:AddItem(part, 6)
- local fire = script.FireEffect:Clone()
- fire.Enabled = true
- fire.Parent = part
- local light = Instance.new("PointLight")
- light.Color = Color3.new(255, 205, 0)
- light.Range = 10
- light.Parent = part
- local velocity = Instance.new("BodyVelocity", part)
- velocity.Velocity = npc.HumanoidRootPart.CFrame.lookVector * 80
- velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
- part.CFrame = npc.Torso.CFrame * CFrame.new(0, 0, -5)
- local sound = script.FireballSound:clone()
- sound.Parent = part
- sound:Play()
- local damagescript = script.FireballDamage:Clone()
- damagescript.Parent = part
- damagescript.Disabled = false
- local tag = Instance.new("ObjectValue", part)
- tag.Name = "creator"
- tag.Value = npc
- part.Parent = game.Workspace
- end
- function speedboost()
- local part = Instance.new("Part", game.Workspace)
- part.Name = "RadiusEffect"
- part.Shape = "Ball"
- part.CanCollide = false
- part.BrickColor = BrickColor.new("Institutional white")
- part.Size = Vector3.new(3,3,3)
- part.Anchored = true
- part.TopSurface = "Smooth"
- part.BottomSurface = "Smooth"
- part.Transparency = 0.1
- part.CFrame = npc:findFirstChild("Torso").CFrame
- game.Debris:AddItem(part, 3)
- hum.WalkSpeed = hum.WalkSpeed * 1.5
- for i = 1, 25 do --animate the ball
- part.Size = part.Size + Vector3.new(0.5,0.5,0.5)
- part.Transparency = part.Transparency + 0.04
- part.CFrame = torso.CFrame
- wait()
- end
- wait(5)
- hum.WalkSpeed = hum.WalkSpeed / 1.5
- end
- function createshockwave()
- local torso = hum.Torso
- wait(0.8)
- local sampleblock = Instance.new("Part", game.Workspace)
- sampleblock.Name = "VelocityGuider"
- sampleblock.CanCollide = false
- sampleblock.Size = Vector3.new(1,1,1)
- sampleblock.Transparency = 1
- sampleblock.CFrame = torso.CFrame * CFrame.new(0,-1,0)
- game.Debris:AddItem(sampleblock, 6)
- local velocity = Instance.new("BodyVelocity", sampleblock)
- velocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- velocity.velocity = torso.CFrame.lookVector * 100
- local group = Instance.new("Model", game.Workspace)
- group.Name = "ShockwaveEffects"
- game.Debris:AddItem(group, 10)
- spawn(function()
- for i = 1,25 do
- if sampleblock ~= nil then
- sampleblock.CFrame = CFrame.new(sampleblock.CFrame.X, torso.CFrame.Y, sampleblock.CFrame.Z)
- local blastblock = Instance.new("Part", group)
- blastblock.Name = "Shockwave"
- blastblock.Anchored = true
- blastblock.CanCollide = false
- blastblock.BrickColor = BrickColor.new("Neon orange")
- blastblock.TopSurface = "Smooth"
- blastblock.BottomSurface = "Smooth"
- blastblock.Transparency = 1
- blastblock.Size = Vector3.new(12,6,12)
- blastblock.CFrame = sampleblock.CFrame * CFrame.Angles(0 , math.rad(math.random(-180,180)) , 0)
- game.Debris:AddItem(blastblock, 6)
- local mesh = Instance.new("SpecialMesh", blastblock)
- mesh.Name = "BlastMesh"
- mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
- mesh.Scale = Vector3.new(0,0,0) --blastblock.Size
- spawn(function()
- for i = 1,9 do
- blastblock.Transparency = blastblock.Transparency - 0.1111111111111111111111111111
- mesh.Scale = mesh.Scale + Vector3.new(1.333333333333333333, 0.666666666666666, 1.333333333333333333)
- wait()
- end
- end)
- local newboom = script.SmallBoom:Clone()
- newboom.Parent = sampleblock
- newboom:Play()
- local shockwavedamage = script.ShockwaveDamage:Clone()
- shockwavedamage.Parent = blastblock
- shockwavedamage.Disabled = false
- local tag = Instance.new("ObjectValue", blastblock)
- tag.Name = "creator"
- tag.Value = npc
- delay(0.5, function()
- for i = 1,20 do
- blastblock.Transparency = blastblock.Transparency + 0.05
- mesh.Scale = mesh.Scale + Vector3.new(0.2, 0.2, 0.2)
- wait()
- end
- end)
- wait(0.2)
- end
- end
- end)
- end
- function fly()
- if torso and hum and hum.Health > 0 then
- local anim = script.SpecialAnimations.Fly
- local animtrack = hum:LoadAnimation(anim)
- animtrack:Play()
- local targettorso = findNearestTorso(torso)
- if targettorso then
- local bp = Instance.new("BodyPosition", torso)
- bp.MaxForce = Vector3.new(400000,400000,400000)
- local randomtime = math.random(30,100)
- for i = 1, randomtime do
- bp.Position = (CFrame.new(targettorso.Position)*CFrame.Angles(0,math.pi*2*((tick()/5)%1),0)*CFrame.new(15,15,0)).p
- wait()
- end
- animtrack:Stop()
- bp:Destroy()
- end
- end
- end
- function abysspower()
- wait(1)
- if torso and hum and hum.Health > 0 and humrootpart then
- spawn(function()
- for i = 1,5 do
- local ring = Instance.new("Part", game.Workspace)
- ring.Name = "ForceFieldRing"
- ring.BrickColor = BrickColor.Red()
- ring.Size = Vector3.new(8,8,10)
- ring.CanCollide = false
- ring.Anchored = true
- ring.TopSurface = "Smooth"
- ring.BottomSurface = "Smooth"
- ring.Transparency = 0.7
- ring.CFrame = torso.CFrame
- game.Debris:AddItem(ring, 30)
- local mesh = Instance.new("SpecialMesh", ring)
- mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
- mesh.Scale = Vector3.new(10, 10, 50)
- spawn(function()
- while true do
- ring.CFrame = torso.CFrame * CFrame.Angles(math.rad(math.random(-180,180)) , math.rad(math.random(-180,180)) , math.rad(math.random(-180,180)))
- wait()
- end
- end)
- end
- end)
- local penta = Instance.new("Part", game.Workspace)
- penta.Name = "Pentagram"
- penta.TopSurface = "Smooth"
- penta.BottomSurface = "Smooth"
- penta.Transparency = 1
- penta.CanCollide = false
- penta.Anchored = true
- penta.Size = Vector3.new(0,0.2,0)
- penta.CFrame = humrootpart.CFrame + Vector3.new(0, -4.4, 0)
- local decal = Instance.new("Decal", penta)
- decal.Face = "Top"
- decal.Texture = "http://www.roblox.com/asset/?id=950330730"
- for i = 1, 50 do
- penta.Size = penta.Size + Vector3.new(1,0,1)
- local pentaRot = penta.CFrame - penta.CFrame.p
- penta.CFrame = humrootpart.CFrame * CFrame.new(0, -4.4, 0) * pentaRot * CFrame.fromEulerAnglesXYZ(0,math.rad(10),0)
- wait()
- end
- wait(5)
- local group = Instance.new("Model", game.Workspace)
- group.Name = "Holes"
- spawn(function()
- for i = 1, 100 do
- local hole = Instance.new("Part", group)
- hole.Name = "Hole"
- hole.CanCollide = false
- hole.Anchored = true
- hole.Transparency = 1
- hole.Size = Vector3.new(0,0.2,0)
- hole.CFrame = humrootpart.CFrame * CFrame.new(math.random(-300,300), -2.75, math.random(-300,300)) * CFrame.Angles(0, math.rad(math.random(-180,180)), 0)
- local decal = Instance.new("Decal", hole)
- decal.Face = "Top"
- decal.Texture = "http://www.roblox.com/asset/?id=963051270"
- local sound = script.HoleCrack:Clone()
- local randompitch = math.random(8,20)
- randompitch = randompitch / 10
- sound.Parent = hole
- sound.Pitch = randompitch
- sound:Play()
- local lavascript = script.LavaScript:Clone()
- lavascript.Parent = hole
- lavascript.Disabled = false
- local tag = Instance.new("ObjectValue", hole)
- tag.Name = "creator"
- tag.Value = npc
- local currentpos = hole.CFrame
- spawn(function()
- for i = 1,25 do
- hole.Size = hole.Size + Vector3.new(5, 0, 5)
- hole.CFrame = currentpos
- wait()
- end
- end)
- wait(math.random(0, 0.5))
- end
- end)
- wait(20)
- group:Destroy()
- penta:Destroy()
- end
- end
- -------------------------------- MAIN SCRIPTS ------------------------------------
- function chase()
- while true do
- local targettorso = findNearestTorso(torso)
- if targettorso and hum.Health > 0 then
- for walkcount = 1,20 do
- if punching == false then
- hum:MoveTo(targettorso.Position, targettorso)
- end
- if walkcount == 10 then
- local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
- if ChosenAttack == "ShootFireball" then
- hum:LoadAnimation(script.SpecialAnimations.FireShoot):Play()
- shootfireball()
- end ----------------------------
- if ChosenAttack == "BlastFireball" then
- hum:LoadAnimation(script.SpecialAnimations.BigFireCast):Play()
- blastfireball()
- end
- if ChosenAttack == "SpeedBoost" then
- spawn(speedboost)
- end
- if ChosenAttack == "Shockwave" then
- hum:LoadAnimation(script.SpecialAnimations.ShockwavePunch):Play()
- createshockwave()
- end
- if ChosenAttack == "Fly" then
- fly()
- end
- if ChosenAttack == "Abyss Power" then
- local chance = math.random(1,5)
- if chance == 1 then
- punching = true
- local oldwalkspeed = hum.WalkSpeed
- hum.WalkSpeed = 0
- hum:LoadAnimation(script.SpecialAnimations.UltimatePower):Play()
- abysspower() -- cannot use spawn()
- hum.WalkSpeed = oldwalkspeed
- punching = false
- end
- end
- end
- wait(0.1)
- end
- end
- wait(math.random(0.1, 1))
- end
- end
- --[[function chase(OLD)
- while true do
- function scan(p)
- for _,target in pairs(p:GetChildren()) do
- if target and target.Parent and target.Parent:FindFirstChild("Humanoid") ~= nil then
- local char = target.Parent
- local targethum = char:FindFirstChild("Humanoid")
- local targettorso = char:FindFirstChild("Torso")
- if targettorso and targethum and targethum.Health > 0 then
- if (targettorso.Position - torso.Position).magnitude <= 100 then
- for walkcount = 1,20 do
- print(walkcount)
- hum:MoveTo(targettorso.Position, targettorso)
- if walkcount == 10 then
- local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
- if ChosenAttack == "ShootFireball" then
- hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
- shootfireball()
- end ----------------------------
- if ChosenAttack == "BlastFireball" then
- hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
- blastfireball()
- end
- if ChosenAttack == "SpeedBoost" then
- spawn(speedboost)
- end
- end
- wait()
- end
- end
- end
- end
- scan(target)
- end
- end
- scan(game.Workspace)
- wait()
- end
- end]]--
- --[[function chase(EVEN OLDER)
- if hum.Health > 0 then
- if p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil then
- debounce = true
- target.Value = p.Parent.Name
- for chance = 1, 20 do
- if debounce == true then --set to false if you don't want it to range attack
- walkcount = walkcount + 1
- end
- if walkcount == 10 then
- local ChosenAttack = SpecialMoves[math.random(1, #SpecialMoves)]
- if ChosenAttack == "ShootFireball" then
- hum:LoadAnimation(script.FireCastAnimations.FireShoot):Play()
- shootfireball()
- end ----------------------------
- if ChosenAttack == "BlastFireball" then
- hum:LoadAnimation(script.FireCastAnimations.BigFireCast):Play()
- blastfireball()
- end
- if ChosenAttack == "SpeedBoost" then
- speedboost()
- hum.WalkSpeed = 16.5 --humanoid speed
- wait(5)
- hum.WalkSpeed = 12 --original speed
- end
- end
- if punching == false then
- if p and p.Parent then
- hum:MoveTo(p.Parent.Torso.Position, p.Parent.Torso)
- end
- end
- wait(0.1)
- end
- walkcount = 0
- end
- end
- end]]--
- function attack(p)
- if hum.Health > 0 then
- if punching == false and p and p.Parent and p.Parent:findFirstChild("Humanoid") and game.Players:FindFirstChild(p.Parent.Name) ~= nil and p.Parent:findFirstChild("Humanoid").Health > 0 then
- local victim = p.Parent
- victim.Humanoid:TakeDamage(math.random(10, 15))
- --victim.Humanoid.Sit = true
- --add velocity or something
- victim.Torso.Velocity = torso.CFrame.lookVector * 50 + Vector3.new(0, 25, 0)
- punching = true
- local attackanimations = script.AttackAnimations:GetChildren()
- local chosenAnim = attackanimations[math.random(1, #attackanimations)]
- hum:LoadAnimation(chosenAnim):Play()
- wait(1)
- punching = false
- end
- end
- end
- spawn(chase)
- torso.Touched:connect(attack)
- end))
- Folder60.Name = "AttackAnimations"
- Folder60.Parent = Script59
- Animation61.Name = "AttackAnim2"
- Animation61.Parent = Folder60
- Animation61.AnimationId = "rbxassetid://498292433"
- NumberValue62.Name = "CooldownTime"
- NumberValue62.Parent = Animation61
- NumberValue62.Value = 0.8
- Animation63.Name = "AttackAnim3"
- Animation63.Parent = Folder60
- Animation63.AnimationId = "rbxassetid://501476461"
- NumberValue64.Name = "CooldownTime"
- NumberValue64.Parent = Animation63
- NumberValue64.Value = 1
- Animation65.Name = "AttackAnim1"
- Animation65.Parent = Folder60
- Animation65.AnimationId = "rbxassetid://498281474"
- NumberValue66.Name = "CooldownTime"
- NumberValue66.Parent = Animation65
- NumberValue66.Value = 1
- Folder67.Name = "SpecialAnimations"
- Folder67.Parent = Script59
- Animation68.Name = "BigFireCast"
- Animation68.Parent = Folder67
- Animation68.AnimationId = "rbxassetid://498346816"
- Animation69.Name = "FireShoot"
- Animation69.Parent = Folder67
- Animation69.AnimationId = "rbxassetid://502043286"
- Animation70.Name = "ShockwavePunch"
- Animation70.Parent = Folder67
- Animation70.AnimationId = "rbxassetid://962368558"
- Animation71.Name = "Fly"
- Animation71.Parent = Folder67
- Animation71.AnimationId = "rbxassetid://962638887"
- Animation72.Name = "UltimatePower"
- Animation72.Parent = Folder67
- Animation72.AnimationId = "rbxassetid://963022822"
- ParticleEmitter73.Name = "FireEffect"
- ParticleEmitter73.Parent = Script59
- ParticleEmitter73.Speed = NumberRange.new(10, 10)
- ParticleEmitter73.Color = ColorSequence.new(Color3.new(1, 0.333333, 0),Color3.new(1, 0.666667, 0))
- ParticleEmitter73.Enabled = false
- ParticleEmitter73.LightEmission = 0.34999999403954
- ParticleEmitter73.Texture = "rbxassetid://494864527"
- ParticleEmitter73.Transparency = NumberSequence.new(0.50625002384186,0,1)
- ParticleEmitter73.Size = NumberSequence.new(0,1.0624998807907,0,0)
- ParticleEmitter73.Lifetime = NumberRange.new(0.5, 0.75)
- ParticleEmitter73.Rate = 200
- ParticleEmitter73.RotSpeed = NumberRange.new(-180, 180)
- Script74.Name = "FireballDamage"
- Script74.Parent = Script59
- table.insert(cors,sandbox(Script74,function()
- local sp = script.Parent
- local creator = sp:WaitForChild("creator")
- --[[function damage(p)
- if game.Players:FindFirstChild(p.Parent.Name) ~= nil then
- if p and p.Parent then
- if p.Name ~= "Handle" then
- script.Disabled = true
- sp.Anchored = true
- sp:FindFirstChild("FireEffect"):Destroy()
- sp.Transparency = 1
- sp:FindFirstChild("PointLight"):Destroy()
- local fire = script.FireEffect
- fire.Parent = p.Parent.Torso
- fire.Enabled = true
- p.Parent:findFirstChild("Humanoid"):TakeDamage(math.random(30,50))
- sp:findFirstChild("FireballSound"):clone().Parent = p.Parent.Torso
- sp:findFirstChild("FireballSound"):Destroy()
- wait(2.5)
- fire.Enabled = false
- for i = 1, 10 do
- if p and p.Parent then
- p.Parent.Torso:findFirstChild("FireballSound").Volume = p.Parent.Torso:findFirstChild("FireballSound").Volume - 0.1
- wait()
- end
- end
- wait(0.5)
- fire:Destroy()
- p.Parent.Torso:findFirstChild("FireballSound"):Destroy()
- script.Parent:Destroy()
- end
- end
- end
- wait(0.025)
- end]]--
- function damage(p)
- if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(creator.Value) then
- local hum = p.Parent:FindFirstChild("Humanoid")
- local torso = p.Parent:FindFirstChild("Torso")
- -- damage the player
- if sp.Name == "Fireball" then
- hum:TakeDamage(math.random(10,20))
- elseif sp.Name == "BigFireball" then
- hum:TakeDamage(math.random(20,40))
- end
- -- make decorations and realism
- sp.Transparency = 1
- sp.Anchored = true
- local newsound = sp.FireballSound:Clone()
- newsound.Parent = torso
- newsound:Play()
- game.Debris:AddItem(newsound, 5)
- sp.FireballSound:remove()
- local neweffect = sp.FireEffect:Clone()
- neweffect.Parent = torso
- game.Debris:AddItem(neweffect, 5)
- sp.FireEffect:remove()
- sp:Destroy()
- end
- end
- script.Parent.Touched:connect(damage)
- end))
- Script74.Disabled = true
- Sound75.Name = "FireballSound"
- Sound75.Parent = Script59
- Sound75.Looped = true
- Sound75.SoundId = "http://www.roblox.com/asset/?id=31760113"
- Sound75.Volume = 1
- Sound76.Name = "SmallBoom"
- Sound76.Parent = Script59
- Sound76.SoundId = "http://roblox.com/asset?id=180120107"
- Script77.Name = "ShockwaveDamage"
- Script77.Parent = Script59
- table.insert(cors,sandbox(Script77,function()
- local sp = script.Parent
- local creator = sp:WaitForChild("creator")
- local debounce = false
- function damage(p)
- if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(creator.Value) then
- if debounce == false then
- debounce = true
- local hum = p.Parent:FindFirstChild("Humanoid")
- local torso = p.Parent:FindFirstChild("Torso")
- -- damage the player
- hum:TakeDamage(math.random(30,50))
- -- make decorations and realism
- local bf = Instance.new("BodyForce", torso)
- bf.Force = Vector3.new(0,9999,0)
- game.Debris:AddItem(bf, 0.25)
- end
- end
- end
- script.Parent.Touched:connect(damage)
- wait(0.5)
- script.Disabled = true
- end))
- Script77.Disabled = true
- Sound78.Name = "HoleCrack"
- Sound78.Parent = Script59
- Sound78.SoundId = "rbxassetid://3086666"
- Sound78.Volume = 0.69999998807907
- Script79.Name = "LavaScript"
- Script79.Parent = Script59
- table.insert(cors,sandbox(Script79,function()
- local sp = script.Parent
- wait(math.random(5, 6))
- local group = Instance.new("Model", game.Workspace)
- group.Name = "LavaEruption"
- game.Debris:AddItem(group, 30)
- for i = 1, 30 do
- local lava = Instance.new("Part")
- lava.Shape = "Ball"
- lava.Size = Vector3.new(50,50,50)
- lava.TopSurface = "Smooth"
- lava.BottomSurface = "Smooth"
- lava.CanCollide = false
- lava.Anchored = false
- lava.Transparency = 1
- lava.CFrame = sp.CFrame
- local effect = script:WaitForChild("LavaEffect"):Clone()
- effect.Parent = lava
- effect.Enabled = true
- game.Debris:AddItem(lava, 10)
- local bf = Instance.new("BodyForce", lava)
- bf.Force = Vector3.new(0,999999999,0)
- game.Debris:AddItem(bf, 1)
- local sound = script:WaitForChild("SmallBoom"):Clone()
- sound.Parent = lava
- sound:Play()
- lava.Parent = group
- lava.Touched:connect(function(p)
- if p and p.Parent and p.Parent:FindFirstChild("Humanoid") and p.Parent:FindFirstChild("Torso") and not p:IsDescendantOf(sp:WaitForChild("creator").Value) then
- p.Parent:FindFirstChild("Humanoid"):TakeDamage(math.random(10,25))
- end
- end)
- wait()
- end
- end))
- Script79.Disabled = true
- ParticleEmitter80.Name = "LavaEffect"
- ParticleEmitter80.Parent = Script79
- ParticleEmitter80.Speed = NumberRange.new(10, 10)
- ParticleEmitter80.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0.666667, 0))
- ParticleEmitter80.Enabled = false
- ParticleEmitter80.LightEmission = 0.34999999403954
- ParticleEmitter80.Texture = "rbxassetid://494864527"
- ParticleEmitter80.Transparency = NumberSequence.new(0.50625002384186,0,1)
- ParticleEmitter80.Size = NumberSequence.new(5.125,10,10,0)
- ParticleEmitter80.Lifetime = NumberRange.new(0.5, 0.75)
- ParticleEmitter80.Rate = 500
- ParticleEmitter80.RotSpeed = NumberRange.new(-180, 180)
- ParticleEmitter80.SpreadAngle = Vector2.new(-90, 90)
- ParticleEmitter80.VelocitySpread = -90
- Sound81.Name = "SmallBoom"
- Sound81.Parent = Script79
- Sound81.SoundId = "http://roblox.com/asset?id=180120107"
- Shirt82.Name = "Shirt"
- Shirt82.Parent = Model0
- Shirt82.ShirtTemplate = "http://www.roblox.com/asset/?id=265030614"
- Pants83.Name = "Pants"
- Pants83.Parent = Model0
- Pants83.PantsTemplate = "http://www.roblox.com/asset/?id=891568032"
- Script84.Name = "Music (Or DeleteMe"
- Script84.Parent = Model0
- table.insert(cors,sandbox(Script84,function()
- --Made by UltimateRobloxian35
- local sound = Instance.new("Sound")
- sound.Name = "Sound"
- sound.SoundId = "http://www.roblox.com/asset/?id=1056097123" --Song
- sound.Volume = .45 --Derp (I have good, loud speakers. You may need to change this.)
- sound.Pitch = 1 --Speed of Playback
- sound.Looped = true
- sound.archivable = false
- sound.Parent = game.Workspace
- wait(0)
- sound:play()
- end))
- Camera85.Name = "ThumbnailCamera"
- Camera85.Parent = Model0
- Camera85.CFrame = CFrame.new(-60.8967094, 6.47413206, 51.2634087, 0.999124408, 0.00890965201, 0.0408784039, 9.31322464e-10, 0.977062047, -0.212955549, -0.0418380871, 0.212769091, 0.976206481)
- Camera85.CoordinateFrame = CFrame.new(-60.8967094, 6.47413206, 51.2634087, 0.999124408, 0.00890965201, 0.0408784039, 9.31322464e-10, 0.977062047, -0.212955549, -0.0418380871, 0.212769091, 0.976206481)
- Camera85.FieldOfView = 39.999999303284
- Camera85.Focus = CFrame.new(-60.978466, 6.90004206, 49.3110008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Camera85.focus = CFrame.new(-60.978466, 6.90004206, 49.3110008, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- BodyColors86.Parent = Model0
- BodyColors86.HeadColor = BrickColor.new("Bright violet")
- BodyColors86.HeadColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors86.LeftArmColor = BrickColor.new("Bright violet")
- BodyColors86.LeftArmColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors86.LeftLegColor = BrickColor.new("Bright violet")
- BodyColors86.LeftLegColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors86.RightArmColor = BrickColor.new("Bright violet")
- BodyColors86.RightArmColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors86.RightLegColor = BrickColor.new("Bright violet")
- BodyColors86.RightLegColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors86.TorsoColor = BrickColor.new("Bright violet")
- BodyColors86.TorsoColor3 = Color3.new(0.419608, 0.196078, 0.486275)
- BodyColors87.Parent = Model0
- BodyColors87.HeadColor = BrickColor.new("Light orange")
- BodyColors87.HeadColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors87.LeftArmColor = BrickColor.new("Light orange")
- BodyColors87.LeftArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors87.LeftLegColor = BrickColor.new("Light orange")
- BodyColors87.LeftLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors87.RightArmColor = BrickColor.new("Light orange")
- BodyColors87.RightArmColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors87.RightLegColor = BrickColor.new("Light orange")
- BodyColors87.RightLegColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- BodyColors87.TorsoColor = BrickColor.new("Light orange")
- BodyColors87.TorsoColor3 = Color3.new(0.917647, 0.721569, 0.572549)
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement