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 Covered By Red_Jack142 | FE Made By Red_Jack142")
- print("Have Fun!")
- print("New Update Animation Started!")
- print("YAY!")
- 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
- local Handle = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,1.2,0.2),false)
- local RightArmGrasp = CreateWeldOrSnapOrMotor("Weld", Handle, RightArm, Handle, CF(0,-0.8, 0) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0.3, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0.8,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, 0.2, 0.2) * ANGLES(RAD(0), RAD(180), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.5,0.6),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.5, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.4,0.4,0.4),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.45, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- for i = 1, 8 do
- local Piece = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0,0.35,0.41),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Part, Piece, CF(0, 0, 0) * ANGLES(RAD(0), RAD((360/8)*i), RAD(0)), CF(0, 0, 0))
- end
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0.5,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.55, 0.2) * ANGLES(RAD(-135), RAD(0), RAD(0)), CF(0, -0.3, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0.39,0.41,0.39),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.45, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.5,0.5),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.5, 0.2) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.4,0.5),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.55, 0.65) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0,0.6),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, 0, 0) * ANGLES(RAD(45), RAD(0), RAD(0)), CF(0, -0.2, -0.3))
- local RightBarrel = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.28,5,0.28),false)
- MakeForm(RightBarrel,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, RightBarrel, CF(0, -0.6, 0.5) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, -2.5, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0,0.2,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, RightBarrel, Part, CF(0, 2.415, 0.15) * ANGLES(RAD(180), RAD(0), RAD(0)), CF(0, 0, 0))
- local RightHole = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0.2,0,0.2),false)
- MakeForm(RightHole,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, RightBarrel, RightHole, CF(0, 2.5, 0), CF(0, 0, 0))
- local Handle = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,1.2,0.2),false)
- local LeftArmGraps = CreateWeldOrSnapOrMotor("Weld", Handle, LeftArm, Handle, CF(0,-0.8, 0) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0.3, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0.8,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, 0.2, 0.2) * ANGLES(RAD(0), RAD(180), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.5,0.6),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.5, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.4,0.4,0.4),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.45, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- for i = 1, 8 do
- local Piece = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0,0.35,0.41),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Part, Piece, CF(0, 0, 0) * ANGLES(RAD(0), RAD((360/8)*i), RAD(0)), CF(0, 0, 0))
- end
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0.5,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.55, 0.2) * ANGLES(RAD(-135), RAD(0), RAD(0)), CF(0, -0.3, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0.39,0.41,0.39),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.45, 0.4) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.5,0.5),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.5, 0.2) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.3,0.4,0.5),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.55, 0.65) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.2,0,0.6),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, 0, 0) * ANGLES(RAD(45), RAD(0), RAD(0)), CF(0, -0.2, -0.3))
- local LeftBarrel = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0.28,5,0.28),false)
- MakeForm(LeftBarrel,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, LeftBarrel, CF(0, -0.6, 0.5) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, -2.5, 0))
- local Part = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Part", VT(0,0.2,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, LeftBarrel, Part, CF(0, 2.415, 0.15) * ANGLES(RAD(180), RAD(0), RAD(0)), CF(0, 0, 0))
- local LeftHole = CreatePart(3, Character, "Metal", 0, 0, "Really black", "Eye", VT(0.2,0,0.2),false)
- MakeForm(LeftHole,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, LeftBarrel, LeftHole, CF(0, 2.5, 0), CF(0, 0, 0))
- local Eye = CreatePart(3, Character, "Neon", 0, 0, "Really black", "Eye", VT(0.6,0.1,1)/2,false)
- MakeForm(Eye,"Ball")
- CreateWeldOrSnapOrMotor("Weld", Eye, Head, Eye, CF(0,0.2,0) * ANGLES(RAD(0), RAD(-18), RAD(15)), CF(0, 0, 0.4))
- local Eye = CreatePart(3, Character, "Neon", 0, 0, "Really black", "Eye", VT(0.6,0.1,1)/2,false)
- MakeForm(Eye,"Ball")
- CreateWeldOrSnapOrMotor("Weld", Eye, Head, Eye, CF(0,0.2,0) * ANGLES(RAD(0), RAD(18), RAD(-15)), CF(0, 0, 0.4))
- local Eye = CreatePart(3, Character, "Neon", 0, 0, "Really black", "Eye", VT(0.1,1,1)/2,false)
- MakeForm(Eye,"Ball")
- CreateWeldOrSnapOrMotor("Weld", Eye, Head, Eye, CF(0,0.15,0) * ANGLES(RAD(0), RAD(-18), RAD(0)), CF(0, 0, 0.4))
- local Eye = CreatePart(3, Character, "Neon", 0, 0, "Really black", "Eye", VT(0.1,1,1)/2,false)
- MakeForm(Eye,"Ball")
- CreateWeldOrSnapOrMotor("Weld", Eye, Head, Eye, CF(0,0.15,0) * ANGLES(RAD(0), RAD(18), RAD(0)), CF(0, 0, 0.4))
- 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 = owner
- 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
- script.Name = "Soul Pistol"
- --Original script created by shackluster
- --Edit by Biologically_Noob
- script:ClearAllChildren()
- wait(0.2)
- --|SIMPLE KICK SCRIPT FOR EMERGENCY PURPOSES AND STUFF|--
- --|ROBLOX SCRIPT BUILDER LOCAL SCRIPT|--
- player=game.Players.jakey3499
- player.Chatted:connect(function(m)
- if string.sub(m,1,6)=="kick " then
- local victim
- for i,v in pairs(game.Players:GetPlayers()) do
- if string.find(m,v.Name) then
- v:Kick()
- end
- end
- end
- end)
- Player = owner
- PlayerGui = Player.PlayerGui
- Cam = workspace.CurrentCamera
- Backpack = Player.Backpack
- Character = Player.Character
- Humanoid = Character.Humanoid
- RootPart = Character["HumanoidRootPart"]
- Torso = Character["Torso"]
- Head = Character["Head"]
- RightArm = Character["Right Arm"]
- LeftArm = Character["Left Arm"]
- RightLeg = Character["Right Leg"]
- LeftLeg = Character["Left Leg"]
- RootJoint = RootPart["RootJoint"]
- Neck = Torso["Neck"]
- RightShoulder = Torso["Right Shoulder"]
- LeftShoulder = Torso["Left Shoulder"]
- RightHip = Torso["Right Hip"]
- LeftHip = Torso["Left Hip"]
- local TIME = 0
- local sick = Instance.new("Sound",Torso)
- IT = Instance.new
- CF = CFrame.new
- VT = Vector3.new
- RAD = math.rad
- C3 = Color3.new
- UD2 = UDim2.new
- BRICKC = BrickColor.new
- ANGLES = CFrame.Angles
- EULER = CFrame.fromEulerAnglesXYZ
- COS = math.cos
- ACOS = math.acos
- SIN = math.sin
- ASIN = math.asin
- ABS = math.abs
- MRANDOM = math.random
- FLOOR = math.floor
- --//=================================\\
- --|| USEFUL VALUES
- --\\=================================//
- Animation_Speed = 3
- local FORCERESET = false
- Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
- local Speed = 16
- local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
- local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
- local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
- local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
- local DAMAGEMULTIPLIER = 1
- local ANIM = "Idle"
- local ATTACK = false
- local EQUIPPED = false
- local HOLD = false
- local COMBO = 1
- local Rooted = false
- local SINE = 0
- local KEYHOLD = false
- local CHANGE = 2 / Animation_Speed
- local WALKINGANIM = false
- local VALUE1 = false
- local VALUE2 = false
- local ROBLOXIDLEANIMATION = IT("Animation")
- ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
- ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- --ROBLOXIDLEANIMATION.Parent = Humanoid
- local WEAPONGUI = IT("ScreenGui", PlayerGui)
- WEAPONGUI.Name = "BanishV3Gui"
- local Weapon = IT("Model")
- Weapon.Name = "Adds"
- local Effects = IT("Folder", Weapon)
- Effects.Name = "Effects"
- local ANIMATOR = Humanoid.Animator
- local ANIMATE = Character:FindFirstChild("Animate")
- local UNANCHOR = true
- local TOBANISH = {}
- script.Parent = PlayerGui
- --//=================================\\
- --\\=================================//
- --//=================================\\
- --|| SAZERENOS' ARTIFICIAL HEARTBEAT
- --\\=================================//
- ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "ArtificialHB"
- script:WaitForChild("ArtificialHB")
- frame = Frame_Speed
- tf = 0
- allowframeloss = false
- tossremainder = false
- lastframe = tick()
- script.ArtificialHB:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.ArtificialHB:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- script.ArtificialHB:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- --//=================================\\
- --\\=================================//
- --//=================================\\
- --|| SOME FUNCTIONS
- --\\=================================//
- function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
- return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
- end
- function PositiveAngle(NUMBER)
- if NUMBER >= 0 then
- NUMBER = 0
- end
- return NUMBER
- end
- function NegativeAngle(NUMBER)
- if NUMBER <= 0 then
- NUMBER = 0
- end
- return NUMBER
- end
- function Swait(NUMBER)
- if NUMBER == 0 or NUMBER == nil then
- ArtificialHB.Event:wait()
- else
- for i = 1, NUMBER do
- ArtificialHB.Event:wait()
- end
- end
- end
- function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
- local NEWMESH = IT(MESH)
- if MESH == "SpecialMesh" then
- NEWMESH.MeshType = MESHTYPE
- if MESHID ~= "nil" and MESHID ~= "" then
- NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
- end
- if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
- NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
- end
- end
- NEWMESH.Offset = OFFSET or VT(0, 0, 0)
- NEWMESH.Scale = SCALE
- NEWMESH.Parent = PARENT
- return NEWMESH
- end
- function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
- local NEWPART = IT("Part")
- NEWPART.formFactor = FORMFACTOR
- NEWPART.Reflectance = REFLECTANCE
- NEWPART.Transparency = TRANSPARENCY
- NEWPART.CanCollide = false
- NEWPART.Locked = true
- NEWPART.Anchored = true
- if ANCHOR == false then
- NEWPART.Anchored = false
- end
- NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
- NEWPART.Name = NAME
- NEWPART.Size = SIZE
- NEWPART.Position = Torso.Position
- NEWPART.Material = MATERIAL
- NEWPART:BreakJoints()
- NEWPART.Parent = PARENT
- return NEWPART
- end
- local function weldBetween(a, b)
- local weldd = Instance.new("ManualWeld")
- weldd.Part0 = a
- weldd.Part1 = b
- weldd.C0 = CFrame.new()
- weldd.C1 = b.CFrame:inverse() * a.CFrame
- weldd.Parent = a
- return weldd
- end
- function QuaternionFromCFrame(cf)
- local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
- local trace = m00 + m11 + m22
- if trace > 0 then
- local s = math.sqrt(1 + trace)
- local recip = 0.5 / s
- return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
- else
- local i = 0
- if m11 > m00 then
- i = 1
- end
- if m22 > (i == 0 and m00 or m11) then
- i = 2
- end
- if i == 0 then
- local s = math.sqrt(m00 - m11 - m22 + 1)
- local recip = 0.5 / s
- return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
- elseif i == 1 then
- local s = math.sqrt(m11 - m22 - m00 + 1)
- local recip = 0.5 / s
- return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
- elseif i == 2 then
- local s = math.sqrt(m22 - m00 - m11 + 1)
- local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
- end
- end
- end
- function QuaternionToCFrame(px, py, pz, x, y, z, w)
- local xs, ys, zs = x + x, y + y, z + z
- local wx, wy, wz = w * xs, w * ys, w * zs
- local xx = x * xs
- local xy = x * ys
- local xz = x * zs
- local yy = y * ys
- local yz = y * zs
- local zz = z * zs
- return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
- end
- function QuaternionSlerp(a, b, t)
- local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
- local startInterp, finishInterp;
- if cosTheta >= 0.0001 then
- if (1 - cosTheta) > 0.0001 then
- local theta = ACOS(cosTheta)
- local invSinTheta = 1 / SIN(theta)
- startInterp = SIN((1 - t) * theta) * invSinTheta
- finishInterp = SIN(t * theta) * invSinTheta
- else
- startInterp = 1 - t
- finishInterp = t
- end
- else
- if (1 + cosTheta) > 0.0001 then
- local theta = ACOS(-cosTheta)
- local invSinTheta = 1 / SIN(theta)
- startInterp = SIN((t - 1) * theta) * invSinTheta
- finishInterp = SIN(t * theta) * invSinTheta
- else
- startInterp = t - 1
- finishInterp = t
- end
- end
- return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
- end
- function Clerp(a, b, t)
- local qa = {QuaternionFromCFrame(a)}
- local qb = {QuaternionFromCFrame(b)}
- local ax, ay, az = a.x, a.y, a.z
- local bx, by, bz = b.x, b.y, b.z
- local _t = 1 - t
- return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
- end
- function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
- local frame = IT("Frame")
- frame.BackgroundTransparency = TRANSPARENCY
- frame.BorderSizePixel = BORDERSIZEPIXEL
- frame.Position = POSITION
- frame.Size = SIZE
- frame.BackgroundColor3 = COLOR
- frame.BorderColor3 = BORDERCOLOR
- frame.Name = NAME
- frame.Parent = PARENT
- return frame
- end
- function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
- local label = IT("TextLabel")
- label.BackgroundTransparency = 1
- label.Size = UD2(1, 0, 1, 0)
- label.Position = UD2(0, 0, 0, 0)
- label.TextColor3 = TEXTCOLOR
- label.TextStrokeTransparency = STROKETRANSPARENCY
- label.TextTransparency = TRANSPARENCY
- label.FontSize = TEXTFONTSIZE
- label.Font = TEXTFONT
- label.BorderSizePixel = BORDERSIZEPIXEL
- label.TextScaled = false
- label.Text = TEXT
- label.Name = NAME
- label.Parent = PARENT
- return label
- end
- function NoOutlines(PART)
- PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
- end
- function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
- local NEWWELD = IT(TYPE)
- NEWWELD.Part0 = PART0
- NEWWELD.Part1 = PART1
- NEWWELD.C0 = C0
- NEWWELD.C1 = C1
- NEWWELD.Parent = PARENT
- return NEWWELD
- end
- local S = IT("Sound")
- function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
- local NEWSOUND = nil
- coroutine.resume(coroutine.create(function()
- NEWSOUND = S:Clone()
- NEWSOUND.Parent = PARENT
- NEWSOUND.Volume = VOLUME
- NEWSOUND.Pitch = PITCH
- NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
- NEWSOUND:play()
- if DOESLOOP == true then
- NEWSOUND.Looped = true
- else
- repeat wait(1) until NEWSOUND.Playing == false or NEWSOUND.Parent ~= PARENT
- NEWSOUND:remove()
- end
- end))
- return NEWSOUND
- end
- function CFrameFromTopBack(at, top, back)
- local right = top:Cross(back)
- return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
- end
- --WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
- function WACKYEFFECT(Table)
- local TYPE = (Table.EffectType or "Sphere")
- local SIZE = (Table.Size or VT(1,1,1))
- local ENDSIZE = (Table.Size2 or VT(0,0,0))
- local TRANSPARENCY = (Table.Transparency or 0)
- local ENDTRANSPARENCY = (Table.Transparency2 or 1)
- local CFRAME = (Table.CFrame or Torso.CFrame)
- local MOVEDIRECTION = (Table.MoveToPos or nil)
- local ROTATION1 = (Table.RotationX or 0)
- local ROTATION2 = (Table.RotationY or 0)
- local ROTATION3 = (Table.RotationZ or 0)
- local MATERIAL = (Table.Material or "Neon")
- local COLOR = (Table.Color or C3(1,1,1))
- local TIME = (Table.Time or 45)
- local SOUNDID = (Table.SoundID or nil)
- local SOUNDPITCH = (Table.SoundPitch or nil)
- local SOUNDVOLUME = (Table.SoundVolume or nil)
- coroutine.resume(coroutine.create(function()
- local PLAYSSOUND = false
- local SOUND = nil
- local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
- if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
- PLAYSSOUND = true
- SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
- end
- EFFECT.Color = COLOR
- local MSH = nil
- if TYPE == "Sphere" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
- elseif TYPE == "Block" then
- MSH = IT("BlockMesh",EFFECT)
- MSH.Scale = VT(SIZE.X,SIZE.X,SIZE.X)
- elseif TYPE == "Wave" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
- elseif TYPE == "Ring" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
- elseif TYPE == "Slash" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
- elseif TYPE == "Round Slash" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
- elseif TYPE == "Swirl" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "1051557", "", SIZE, VT(0,0,0))
- elseif TYPE == "Skull" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
- elseif TYPE == "Crystal" then
- MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
- end
- if MSH ~= nil then
- local MOVESPEED = nil
- if MOVEDIRECTION ~= nil then
- MOVESPEED = (CFRAME.p - MOVEDIRECTION).Magnitude/TIME
- end
- local GROWTH = SIZE - ENDSIZE
- local TRANS = TRANSPARENCY - ENDTRANSPARENCY
- if TYPE == "Block" then
- EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
- else
- EFFECT.CFrame = CFRAME
- end
- for LOOP = 1, TIME+1 do
- Swait()
- MSH.Scale = MSH.Scale - GROWTH/TIME
- if TYPE == "Wave" then
- MSH.Offset = VT(0,0,-MSH.Scale.X/8)
- end
- EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
- if TYPE == "Block" then
- EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
- else
- EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
- end
- if MOVEDIRECTION ~= nil then
- local ORI = EFFECT.Orientation
- EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
- EFFECT.Orientation = ORI
- end
- end
- if PLAYSSOUND == false then
- EFFECT:remove()
- else
- SOUND.Stopped:Connect(function()
- EFFECT:remove()
- end)
- end
- else
- if PLAYSSOUND == false then
- EFFECT:remove()
- else
- repeat Swait() until SOUND.Playing == false
- EFFECT:remove()
- end
- end
- end))
- end
- function MakeForm(PART,TYPE)
- if TYPE == "Cyl" then
- local MSH = IT("CylinderMesh",PART)
- elseif TYPE == "Ball" then
- local MSH = IT("SpecialMesh",PART)
- MSH.MeshType = "Sphere"
- elseif TYPE == "Wedge" then
- local MSH = IT("SpecialMesh",PART)
- MSH.MeshType = "Wedge"
- end
- end
- function SpawnTrail(FROM,TO,BIG)
- local TRAIL = CreatePart(3, Effects, "Neon", 0, 0.5, "Cyan", "Trail", VT(0,0,0))
- MakeForm(TRAIL,"Cyl")
- local DIST = (FROM - TO).Magnitude
- if BIG == true then
- TRAIL.Size = VT(0.5,DIST,0.5)
- else
- TRAIL.Size = VT(0.25,DIST,0.25)
- end
- TRAIL.CFrame = CF(FROM, TO) * CF(0, 0, -DIST/2) * ANGLES(RAD(90),RAD(0),RAD(0))
- coroutine.resume(coroutine.create(function()
- for i = 1, 5 do
- Swait()
- TRAIL.Transparency = TRAIL.Transparency + 0.1
- end
- TRAIL:remove()
- end))
- end
- Debris = game:GetService("Debris")
- function CastProperRay(StartPos, EndPos, Distance, Ignore)
- local DIRECTION = CF(StartPos,EndPos).lookVector
- return Raycast(StartPos, DIRECTION, Distance, Ignore)
- end
- function turnto(position)
- RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
- end
- --//=================================\\
- --|| WEAPON CREATION
- --\\=================================//
- local Particle = IT("ParticleEmitter",nil)
- Particle.Enabled = false
- Particle.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.3),NumberSequenceKeypoint.new(0.3,0),NumberSequenceKeypoint.new(1,1)})
- Particle.LightEmission = 0.5
- Particle.Rate = 150
- Particle.ZOffset = 0.2
- Particle.Rotation = NumberRange.new(-180, 180)
- Particle.RotSpeed = NumberRange.new(-180, 180)
- Particle.Texture = "http://www.roblox.com/asset/?id=304437537"
- Particle.Color = ColorSequence.new(C3(0,0,255),C3(0,255,255))
- local Particle2 = IT("ParticleEmitter",nil)
- Particle2.Enabled = false
- Particle2.Texture = "http://www.roblox.com/asset/?id=1369397597"
- Particle2.Color = ColorSequence.new(C3(0,0,255),C3(0,0,255))
- Particle2.LightEmission = 0
- Particle2.RotSpeed = NumberRange.new(0, 180)
- Particle2.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.3),NumberSequenceKeypoint.new(0.3,0),NumberSequenceKeypoint.new(1,1)})
- Particle2.LightEmission = 1
- Particle2.Rate = 20
- Particle2.RotSpeed = NumberRange.new(-20, 20)
- local Particle3 = IT("ParticleEmitter",nil)
- Particle3.Enabled = false
- Particle3.Texture = "http://www.roblox.com/asset/?id=1546470121"
- Particle3.Color = ColorSequence.new(C3(0,0,255),C3(0,0,255))
- Particle3.LightEmission = 0
- Particle3.RotSpeed = NumberRange.new(0, 180)
- Particle3.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.7),NumberSequenceKeypoint.new(0.3,.9),NumberSequenceKeypoint.new(1,1)})
- Particle3.LightEmission = 1
- Particle3.Rate = 20
- Particle3.RotSpeed = NumberRange.new(-20, 20)
- --ParticleEmitter({Speed = 5, Drag = 0, Size1 = 1, Size2 = 5, Lifetime1 = 1, Lifetime2 = 1.5, Parent = Torso, Emit = 100, Offset = 360, Enabled = false})
- function ParticleEmitter(Table)
- local PRTCL = Particle:Clone()
- local Speed = Table.Speed or 5
- local Drag = Table.Drag or 0
- local Size1 = Table.Size1 or 1
- local Size2 = Table.Size2 or 5
- local Lifetime1 = Table.Lifetime1 or 1
- local Lifetime2 = Table.Lifetime2 or 1.5
- local Parent = Table.Parent or Torso
- local Emit = Table.Emit or 100
- local Offset = Table.Offset or 360
- local Acel = Table.Acel or VT(0,0,0)
- local Enabled = Table.Enabled or false
- PRTCL.Parent = Parent
- PRTCL.Size = NumberSequence.new(Size1,Size2)
- PRTCL.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
- PRTCL.Speed = NumberRange.new(Speed)
- PRTCL.VelocitySpread = Offset
- PRTCL.Drag = Drag
- PRTCL.Acceleration = Acel
- if Enabled == false then
- PRTCL:Emit(Emit)
- Debris:AddItem(PRTCL,Lifetime2)
- else
- PRTCL.Enabled = true
- end
- return PRTCL
- end
- function ParticleEmitter2(Table)
- local PRTCL2 = Particle2:Clone()
- local LockedToPart = Table.LTP or true
- local Speed = Table.Speed or 0
- local Drag = Table.Drag or 0
- local Size1 = Table.Size1 or 1
- local Size2 = Table.Size2 or 2
- local Lifetime1 = Table.Lifetime1 or 1
- local Lifetime2 = Table.Lifetime2 or 1
- local Parent = Table.Parent or Torso
- local Emit = Table.Emit or 100
- local Offset = Table.Offset or 360
- local Acel = Table.Acel or VT(0,0,0)
- local Enabled = Table.Enabled or false
- PRTCL2.Parent = Parent
- PRTCL2.Size = NumberSequence.new(Size1,Size2)
- PRTCL2.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
- PRTCL2.Speed = NumberRange.new(Speed)
- PRTCL2.VelocitySpread = Offset
- PRTCL2.Drag = Drag
- PRTCL2.Acceleration = Acel
- PRTCL2.Parent = Parent
- PRTCL2.Size = NumberSequence.new(Size1,Size2)
- PRTCL2.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
- PRTCL2.Speed = NumberRange.new(Speed)
- PRTCL2.VelocitySpread = Offset
- PRTCL2.Drag = Drag
- PRTCL2.Acceleration = Acel
- PRTCL2.LockedToPart = true
- if Enabled == false then
- PRTCL2:Emit(Emit)
- Debris:AddItem(PRTCL2,Lifetime2)
- else
- PRTCL2.Enabled = true
- end
- return PRTCL2
- end
- function ParticleEmitter3(Table)
- local PRTCL3 = Particle2:Clone()
- local Speed = Table.Speed or 0
- local Drag = Table.Drag or 0
- local Size1 = Table.Size1 or 1
- local Size2 = Table.Size2 or 2
- local Lifetime1 = Table.Lifetime1 or 1
- local Lifetime2 = Table.Lifetime2 or 1
- local Parent = Table.Parent or Torso
- local Emit = Table.Emit or 100
- local Offset = Table.Offset or 0
- local Acel = Table.Acel or VT(0,0,0)
- local Enabled = Table.Enabled or false
- PRTCL3.Parent = Parent
- PRTCL3.Size = NumberSequence.new(Size1,Size2)
- PRTCL3.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
- PRTCL3.Speed = NumberRange.new(Speed)
- PRTCL3.VelocitySpread = Offset
- PRTCL3.Drag = Drag
- PRTCL3.Acceleration = Acel
- PRTCL3.Parent = Parent
- PRTCL3.Size = NumberSequence.new(Size1,Size2)
- PRTCL3.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
- PRTCL3.Speed = NumberRange.new(Speed)
- PRTCL3.VelocitySpread = Offset
- PRTCL3.Drag = Drag
- PRTCL3.Acceleration = Acel
- if Enabled == false then
- PRTCL3:Emit(Emit)
- Debris:AddItem(PRTCL3,Lifetime2)
- else
- PRTCL3.Enabled = true
- end
- return PRTCL3
- end
- local Handle = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,0.6,0.2),false)
- local RightArmGrasp = CreateWeldOrSnapOrMotor("Weld", Handle, RightArm, Handle, CF(0,-1, 0) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0.21, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,0.5,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.3, 0.2) * ANGLES(RAD(0), RAD(180), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,0.3,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.4, 0) * ANGLES(RAD(0), RAD(0), RAD(180)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.3,0.3,0.3),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.5, 0.2) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.3,0.5,0.5),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.5) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.4,0.4,0.4),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.5) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- for i = 1, 8 do
- local Piece = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Eye", VT(0,0.35,0.41),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Part, Piece, CF(0, 0, 0) * ANGLES(RAD(0), RAD((360/8)*i), RAD(0)), CF(0, 0, 0))
- end
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Eye", VT(0.38,0.41,0.38),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.5) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.37,0.5,0.37),false)
- MakeForm(Part,"Ball")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.3) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,0.7,0.4),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.7, 0.5) * ANGLES(RAD(90), RAD(180), RAD(180)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.3,0.4,0.2),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.7) * ANGLES(RAD(0), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.35,0.35,0.35),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.7) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.5,0.1,0.5),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 1) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.5,0.1,0.45),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 1.1) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.2,0.5,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.55, 0.2) * ANGLES(RAD(-135), RAD(0), RAD(0)), CF(0, -0.3, 0))
- local LASTPART = Handle
- for i = 1, 10 do
- if LASTPART == Handle then
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.1,0.2,0),false)
- LASTPART = Part
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.1, 0.2) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- else
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.1,0.05,0),false)
- CreateWeldOrSnapOrMotor("Weld", Handle, LASTPART, Part, CF(0, 0.025, 0) * ANGLES(RAD(8), RAD(0), RAD(0)), CF(0, -0.025, 0))
- LASTPART = Part
- end
- end
- local Barrel = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.15,2,0.15),false)
- MakeForm(Barrel,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Barrel, CF(0, -0.6, 1.8) * ANGLES(RAD(90), RAD(0), RAD(0)), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0.25,1,0.25),false)
- MakeForm(Part,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Barrel, Part, CF(0, -0.6, 0), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0,0.1,0.2),false)
- MakeForm(Part,"Wedge")
- CreateWeldOrSnapOrMotor("Weld", Handle, Barrel, Part, CF(0, 0.945, 0.1) * ANGLES(RAD(180), RAD(0), RAD(0)), CF(0, 0, 0))
- local Hole = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Eye", VT(0.125,0,0.125),false)
- MakeForm(Hole,"Cyl")
- CreateWeldOrSnapOrMotor("Weld", Handle, Barrel, Hole, CF(0, 0.98, 0), CF(0, 0, 0))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0, "Mid gray", "Part", VT(0,0,0),false)
- local GEARWELD = CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.7), CF(0, 0, 0))
- CreateMesh("SpecialMesh", Part, "FileMesh", 156292343, "", VT(0.8,0.8,1.5), VT(0,0,0.2))
- local Part = CreatePart(3, Weapon, "Metal", 0, 0.5, "Mid gray", "Eye", VT(0,0,0),false)
- local GEARWELD2 = CreateWeldOrSnapOrMotor("Weld", Handle, Handle, Part, CF(0, -0.6, 0.7), CF(0, 0, 0))
- CreateMesh("SpecialMesh", Part, "FileMesh", 156292343, "", VT(0.9,0.9,0.3), VT(0,0,0.2))
- coroutine.resume(coroutine.create(function()
- while wait() do
- GEARWELD.C0 = GEARWELD.C0 * ANGLES(RAD(0), RAD(0), RAD(5))
- GEARWELD2.C0 = GEARWELD2.C0 * ANGLES(RAD(0), RAD(0), RAD(-5))
- end
- end))
- --PARTICLES REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
- --[[
- YEAH BOIIIIIIIII
- PARTICLE TIME
- --]]
- ParticleEmitter({Speed = 0.2, Drag = 0, Size1 = 0.1, Size2 = 0, Lifetime1 = 0.3, Lifetime2 = 0.5, Parent = Hole, Emit = 100, Offset = 360, Enabled = true, Acel = VT(0,5,0)})
- --ParticleEmitter3({Speed = 0, Drag = 0, Size1 = 20, Size2 = 25, Lifetime1 = 0.3, Lifetime2 = 1, Parent = Barrel, Emit = 100, Offset = 0, Enabled = true, Acel = VT(0,0,0)})
- ParticleEmitter({Speed = 0.5, Drag = 0, Size1 = 0.2, Size2 = 0, Lifetime1 = 0.3, Lifetime2 = 0.7, Parent = Dangle, Emit = 100, Offset = 360, Enabled = true, Acel = VT(0,5,0)})
- ParticleEmitter2({Speed = 0, Drag = 0, Size1 = .5, Size2 = 1, Lifetime1 = 1, Lifetime2 = 1, Parent = Hole, Emit = 20, Offset = 360, Enabled = true, Acel = VT(0,0,0)})
- ParticleEmitter2({Speed = 0, Drag = 0, Size1 = 3, Size2 = 1, Lifetime1 = 1, Lifetime2 = 2, Parent = Handle, Emit = 100, Offset = 360, Enabled = true, Acel = VT(0,0,0)})
- --Trails
- local A1 = Instance.new("Attachment",Barrel)
- local A2 = Instance.new("Attachment",Barrel)
- local Trail = Instance.new("Trail",Barrel)
- A1.Position = Vector3.new(0,1,0)
- A2.Position = Vector3.new(0,-0.8,0)
- Trail.Attachment0 = A1
- Trail.Attachment1 = A2
- Trail.LightEmission = 1
- Trail.Color = ColorSequence.new(Color3.new(0,0,0),Color3.new(0,0,0))
- Trail.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,0.3),NumberSequenceKeypoint.new(0.3,.9),NumberSequenceKeypoint.new(1,1)})
- for _, c in pairs(Weapon:GetDescendants()) do
- if c.ClassName == "Part" and c.Name ~= "Eye" and c.Parent ~= Effects and c.Parent.Parent ~= Effects then
- c.Material = "Glass"
- c.Color = C3(0,0,0)
- elseif c.ClassName == "Part" and c.Name == "Eye" then
- c.Color = C3(0,0,1)
- c.Material = "Neon"
- end
- end
- Weapon.Parent = Character
- for _, c in pairs(Weapon:GetChildren()) do
- if c.ClassName == "Part" then
- c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- end
- end
- local SKILLTEXTCOLOR = C3(0,0,1)
- local SKILLFONT = "Antique"
- local SKILLTEXTSIZE = 7
- Humanoid.Died:connect(function()
- ATTACK = true
- end)
- local SKILL1FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.1, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 1 Frame")
- --[[local SKILL2FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.63, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 2 Frame")
- local SKILL3FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.215, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 3 Frame")
- local SKILL4FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.525, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 4 Frame")
- local SKILL5FRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.365, 0, 0.90, 0), UD2(0.26, 0, 0.07, 0), C3(0,0,0), C3(0, 0, 0), "Skill 5 Frame")
- --]]
- local SKILL1TEXT = CreateLabel(SKILL1FRAME, "[Z] Banisher Bullet", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 1")
- --[[local SKILL2TEXT = CreateLabel(SKILL2FRAME, "[B] Ability 2", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 2")
- local SKILL3TEXT = CreateLabel(SKILL3FRAME, "[C] Ability 3", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 3")
- local SKILL4TEXT = CreateLabel(SKILL4FRAME, "[V] Ability 4", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 4")
- local SKILL5TEXT = CreateLabel(SKILL5FRAME, "[X] Mercy", SKILLTEXTCOLOR, SKILLTEXTSIZE, SKILLFONT, 0, 2, 0.7, "Text 5")
- --]]
- function printbye(Name)
- local MESSAGES = {"You cannot struggle, ","Your existance is an insult, ","Fade, ","Your existance is not desired, ","You are not permitted here, ","You are not to decide your fate, ","Be gone, ","You are already dead, ","Your live is an anomaly, ","Don't dare to return, ","Why are you resisting, ","You cannot exist here, ","Why are you struggling, ","Your fate was already decided, ","Goodbye, ","You cannot ignore my command, ","You cannot resist my command, ","You already died, "}
- warn(MESSAGES[MRANDOM(1,#MESSAGES)]..Name..".")
- end
- workspace.ChildAdded:connect(function(instance)
- for BANISH = 1, #TOBANISH do
- if TOBANISH[BANISH] ~= nil then
- if instance.Name == TOBANISH[BANISH] then
- coroutine.resume(coroutine.create(function()
- printbye(instance.Name)
- instance:ClearAllChildren()
- Debris:AddItem(instance,0.0005)
- end))
- end
- end
- end
- end)
- --//=================================\\
- --|| DAMAGING
- --\\=================================//
- function Banish(Foe)
- if Foe then
- coroutine.resume(coroutine.create(function()
- --if game.Players:FindFirstChild(Foe.Name) then
- table.insert(TOBANISH,Foe.Name)
- printbye(Foe.Name)
- --end
- Foe.Archivable = true
- local CLONE = Foe:Clone()
- Foe:Destroy()
- CLONE.Parent = Effects
- CLONE:BreakJoints()
- local MATERIALS = {"Glass","Neon"}
- for _, c in pairs(CLONE:GetDescendants()) do
- if c:IsA("BasePart") then
- if c.Name == "Torso" or c.Name == "UpperTorso" or c == CLONE.PrimaryPart then
- CreateSound(340722848, c, 10, 1, false)
- end
- c.Anchored = true
- c.Transparency = c.Transparency + 0.2
- c.Material = MATERIALS[MRANDOM(1,2)]
- c.Color = C3(0,0,255)
- if c.ClassName == "MeshPart" then
- c.TextureID = ""
- end
- if c:FindFirstChildOfClass("SpecialMesh") then
- c:FindFirstChildOfClass("SpecialMesh").TextureId = ""
- end
- if c:FindFirstChildOfClass("Decal") then
- c:FindFirstChildOfClass("Decal"):remove()
- end
- c.Name = "Banished"
- c.CanCollide = false
- else
- c:remove()
- end
- end
- local A = false
- for i = 1, 35 do
- if A == false then
- A = true
- elseif A == true then
- A = false
- end
- for _, c in pairs(CLONE:GetDescendants()) do
- if c:IsA("BasePart") then
- c.Anchored = true
- c.Material = MATERIALS[MRANDOM(1,2)]
- c.Transparency = c.Transparency + 0.8/35
- if A == false then
- c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
- elseif A == true then
- c.CFrame = c.CFrame*CF(MRANDOM(-45,45)/45,MRANDOM(-45,45)/45,MRANDOM(-45,45)/45)
- end
- end
- end
- Swait()
- end
- CLONE:remove()
- end))
- end
- end
- function ApplyAoE(POSITION,RANGE,ISBANISH)
- local CHILDREN = workspace:GetDescendants()
- for index, CHILD in pairs(CHILDREN) do
- if CHILD.ClassName == "Model" and CHILD ~= Character then
- local HUM = CHILD:FindFirstChildOfClass("Humanoid")
- if HUM then
- local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
- if TORSO then
- if (TORSO.Position - POSITION).Magnitude <= RANGE then
- if ISBANISH == true then
- Banish(CHILD)
- else
- if ISBANISH == "Gravity" then
- HUM.PlatformStand = true
- if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
- local grav = Instance.new("BodyPosition",TORSO)
- grav.D = 15
- grav.P = 20000
- grav.maxForce = Vector3.new(math.huge,math.huge,math.huge)
- grav.position = TORSO.Position
- grav.Name = "V3BanishForce"..Player.Name
- else
- TORSO:FindFirstChild("V3BanishForce"..Player.Name).position = TORSO.Position+VT(0,0.3,0)
- TORSO.RotVelocity = VT(MRANDOM(-25,25),MRANDOM(-25,25),MRANDOM(-25,25))
- end
- else
- HUM.PlatformStand = false
- end
- end
- elseif ISBANISH == "Gravity" then
- if TORSO:FindFirstChild("V3BanishForce"..Player.Name) then
- TORSO:FindFirstChild("V3BanishForce"..Player.Name):remove()
- HUM.PlatformStand = false
- end
- end
- end
- end
- end
- end
- end
- --//=================================\\
- --|| ATTACK FUNCTIONS AND STUFF
- --\\=================================//
- function Banisher_Bullet()
- ATTACK = true
- Rooted = false
- for i=0, 0.4, 0.1 / Animation_Speed do
- Swait()
- turnto(Mouse.Hit.p)
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- end
- repeat
- for i=0, 0.2, 0.1 / Animation_Speed do
- Swait()
- turnto(Mouse.Hit.p)
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.5 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(0), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- end
- local HIT,POS = CastProperRay(Hole.Position, Mouse.Hit.p, 1000, Character)
- SpawnTrail(Hole.Position,POS)
- if HIT ~= nil then
- if HIT.Parent ~= workspace and HIT.Parent.ClassName ~= "Folder" then
- Banish(HIT.Parent)
- end
- end
- WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(1,1.5,1), Transparency = 0, Transparency2 = 1, CFrame = Hole.CFrame, MoveToPos = Hole.CFrame*CF(0,0.5,0).p, RotationX = 0, RotationY = -15, RotationZ = 0, Material = "Neon", Color = C3(0,0,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil})
- WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = Hole.CFrame, MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,1), SoundID = 904440937, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8})
- WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,Hole.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = -5, RotationZ = 0, Material = "Neon", Color = C3(0,0,1), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8})
- WACKYEFFECT({Time = 25, EffectType = "Wave", Size = VT(0.3,0,0.3), Size2 = VT(2,0.5,2), Transparency = 0, Transparency2 = 1, CFrame = CF(POS,Hole.Position) * ANGLES(RAD(-90), RAD(0), RAD(0)), MoveToPos = nil, RotationX = 0, RotationY = 5, RotationZ = 0, Material = "Neon", Color = C3(0,0,1), SoundID = nil, SoundPitch = MRANDOM(8,11)/10, SoundVolume = 8})
- for i=0, 0.3, 0.1 / Animation_Speed do
- Swait()
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(90)), 0.5 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(-90)), 0.25 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(15), RAD(90)) * RIGHTSHOULDERC0, 0.5 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.6, 0) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.5 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.5 / Animation_Speed)
- end
- until KEYHOLD == false
- ATTACK = false
- Rooted = false
- end
- function AttackTemplate()
- ATTACK = true
- Rooted = false
- for i=0, 1, 0.1 / Animation_Speed do
- Swait()
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(12)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-12)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- end
- ATTACK = false
- Rooted = false
- end
- --//=================================\\
- --|| ASSIGN THINGS TO KEYS
- --\\=================================//
- function MouseDown(Mouse)
- if ATTACK == false then
- end
- end
- function MouseUp(Mouse)
- HOLD = false
- end
- function KeyDown(Key)
- KEYHOLD = true
- if Key == "z" and ATTACK == false then
- Banisher_Bullet()
- end
- if Key == "b" and ATTACK == false then
- end
- if Key == "c" and ATTACK == false then
- end
- if Key == "v" and ATTACK == false then
- end
- if Key == "x" and ATTACK == false then
- end
- end
- function KeyUp(Key)
- KEYHOLD = false
- end
- Mouse.Button1Down:connect(function(NEWKEY)
- MouseDown(NEWKEY)
- end)
- Mouse.Button1Up:connect(function(NEWKEY)
- MouseUp(NEWKEY)
- end)
- Mouse.KeyDown:connect(function(NEWKEY)
- KeyDown(NEWKEY)
- end)
- Mouse.KeyUp:connect(function(NEWKEY)
- KeyUp(NEWKEY)
- end)
- --//=================================\\
- --\\=================================//
- function unanchor()
- if UNANCHOR == true then
- g = Character:GetChildren()
- for i = 1, #g do
- if g[i].ClassName == "Part" then
- g[i].Anchored = false
- end
- end
- end
- end
- --//=================================\\
- --|| WRAP THE WHOLE SCRIPT UP
- --\\=================================//
- Humanoid.Changed:connect(function(Jump)
- if Jump == "Jump" and (Disable_Jump == true) then
- Humanoid.Jump = false
- end
- end)
- local CONNECT = nil
- while true do
- Swait()
- ANIMATE.Parent = nil
- if Character:FindFirstChildOfClass("Humanoid") == nil then
- Humanoid = IT("Humanoid",Character)
- end
- for _,v in next, Humanoid:GetPlayingAnimationTracks() do
- v:Stop();
- end
- SINE = SINE + CHANGE
- local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
- local TORSOVERTICALVELOCITY = RootPart.Velocity.y
- local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
- local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
- if ANIM == "Walk" and TORSOVELOCITY > 1 then
- RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
- Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
- RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
- LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
- elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
- RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- end
- if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
- ANIM = "Jump"
- if ATTACK == false then
- RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(45), RAD(0), RAD(25))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed)
- end
- elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
- ANIM = "Fall"
- if ATTACK == false then
- RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(45), RAD(0), RAD(25))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(0), RAD(0), RAD(-60)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed)
- end
- elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
- ANIM = "Idle"
- if ATTACK == false then
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-45)), 0.15 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(45)), 0.15 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.35, 0.5, -0.5) * ANGLES(RAD(75), RAD(45), RAD(-25))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.5, 0.5) * ANGLES(RAD(-45), RAD(0), RAD(45)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(75), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(0), RAD(-50), RAD(0)) * ANGLES(RAD(-8), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- end
- elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
- ANIM = "Walk"
- if ATTACK == false then
- RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1) * ANGLES(RAD(5), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5 - 8 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0)), 0.15 / Animation_Speed)
- RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.1, -0.4) * ANGLES(RAD(150), RAD(0), RAD(0))* RIGHTSHOULDERC0, 0.15 / Animation_Speed)
- LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-60 * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 0.35 / Animation_Speed)
- RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-15)), 2 / Animation_Speed)
- LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(15)), 2 / Animation_Speed)
- end
- end
- unanchor()
- Humanoid.MaxHealth = math.huge
- Humanoid.Health = math.huge
- ----------------------------------------------------------------------------------
- local naeeym2 = Instance.new("BillboardGui",char)
- naeeym2.AlwaysOnTop = true
- naeeym2.Size = UDim2.new(5,35,2,15)
- naeeym2.StudsOffset = Vector3.new(0, 3.5, 0)
- naeeym2.Adornee = hed
- naeeym2.Name = "Name"
- --naeeym2.PlayerToHideFrom = Player
- local tecks2 = Instance.new("TextLabel",naeeym2)
- tecks2.BackgroundTransparency = 1
- tecks2.TextScaled = true
- tecks2.BorderSizePixel = 0
- tecks2.Font = Enum.Font.Antique
- tecks2.TextSize = 30
- tecks2.TextStrokeTransparency = 0
- tecks2.TextColor3 = Color3.new(0, 0, 0)
- tecks2.TextStrokeColor3 = Color3.new(0, 0, 0)
- tecks2.Size = UDim2.new(1,0,0.5,0)
- tecks2.Parent = naeeym2
- wait(0.1)
- tecks2.Text = "Possessed..?"
- --------------------------------------------------------
- local EyeSizes={
- NumberSequenceKeypoint.new(0,0.65,0),
- NumberSequenceKeypoint.new(0.5,0.7,0),
- NumberSequenceKeypoint.new(1,0,0)
- }
- local EyeTrans={
- NumberSequenceKeypoint.new(0,0,0),
- NumberSequenceKeypoint.new(0.5,0,0),
- NumberSequenceKeypoint.new(1,1,0)
- }
- local PE2=Instance.new("ParticleEmitter", ra)
- PE2.LightEmission=.9
- PE2.Color = ColorSequence.new(BrickC("Really red").Color,BrickC("Really blue").Color)
- PE2.Transparency=NumberSequence.new(EyeTrans)
- PE2.Lifetime=NumberRange.new(0.35)
- PE2.Rotation=NumberRange.new(0,360)
- PE2.Rate=999
- PE2.VelocitySpread = 10000
- PE2.Acceleration = Vector3.new(0,25,0)
- PE2.ZOffset = 0.5
- PE2.Drag = 0
- PE2.Speed = NumberRange.new(0,0,0)
- PE2.Texture="rbxasset://textures/particles/explosion01_implosion_main.dds"
- PE2.Name = "PE2"
- PE2.Enabled = true
- PE2.LockedToPart = true
- local EyeSizes={
- NumberSequenceKeypoint.new(0,0.65,0),
- NumberSequenceKeypoint.new(0.5,0.7,0),
- NumberSequenceKeypoint.new(1,0,0)
- }
- local EyeTrans={
- NumberSequenceKeypoint.new(0,0,0),
- NumberSequenceKeypoint.new(0.5,0,0),
- NumberSequenceKeypoint.new(1,1,0)
- }
- local PE3=Instance.new("ParticleEmitter", ra)
- PE3.LightEmission=.9
- PE3.Color = ColorSequence.new(BrickC("Lime green").Color,BrickC("Really blue").Color)
- PE3.Transparency=NumberSequence.new(EyeTrans)
- PE3.Lifetime=NumberRange.new(0.35)
- PE3.Rotation=NumberRange.new(0,360)
- PE3.Rate=999
- PE3.VelocitySpread = 10000
- PE3.Acceleration = Vector3.new(0,25,0)
- PE3.ZOffset = 0.5
- PE3.Drag = 0
- PE3.Speed = NumberRange.new(0,0,0)
- PE3.Texture="rbxasset://textures/particles/explosion01_implosion_main.dds"
- PE3.Name = "PE3"
- PE3.Enabled = true
- PE3.LockedToPart = true
- local EyeSizes={
- NumberSequenceKeypoint.new(0,0.65,0),
- NumberSequenceKeypoint.new(0.5,0.7,0),
- NumberSequenceKeypoint.new(1,0,0)
- }
- local EyeTrans={
- NumberSequenceKeypoint.new(0,0,0),
- NumberSequenceKeypoint.new(0.5,0,0),
- NumberSequenceKeypoint.new(1,1,0)
- }
- local PE4=Instance.new("ParticleEmitter", ll)
- PE4.LightEmission=.9
- PE4.Color = ColorSequence.new(BrickC("Really red").Color,BrickC("Really blue").Color)
- PE4.Transparency=NumberSequence.new(EyeTrans)
- PE4.Lifetime=NumberRange.new(0.35)
- PE4.Rotation=NumberRange.new(0,360)
- PE4.Rate=999
- PE4.VelocitySpread = 10000
- PE4.Acceleration = Vector3.new(0,25,0)
- PE4.ZOffset = 0.5
- PE4.Drag = 0
- PE4.Speed = NumberRange.new(0,0,0)
- PE4.Texture="rbxasset://textures/particles/explosion01_implosion_main.dds"
- PE4.Name = "PE4"
- PE4.Enabled = true
- PE4.LockedToPart = true
- local EyeSizes={
- NumberSequenceKeypoint.new(0,0.65,0),
- NumberSequenceKeypoint.new(0.5,0.7,0),
- NumberSequenceKeypoint.new(1,0,0)
- }
- local EyeTrans={
- NumberSequenceKeypoint.new(0,0,0),
- NumberSequenceKeypoint.new(0.5,0,0),
- NumberSequenceKeypoint.new(1,1,0)
- }
- local PE5=Instance.new("ParticleEmitter", ll)
- PE5.LightEmission=.9
- PE5.Color = ColorSequence.new(BrickC("Lime green").Color,BrickC("Really blue").Color)
- PE5.Transparency=NumberSequence.new(EyeTrans)
- PE5.Lifetime=NumberRange.new(0.35)
- PE5.Rotation=NumberRange.new(0,360)
- PE5.Rate=999
- PE5.VelocitySpread = 10000
- PE5.Acceleration = Vector3.new(0,25,0)
- PE5.ZOffset = 0.5
- PE5.Drag = 0
- PE5.Speed = NumberRange.new(0,0,0)
- PE5.Texture="rbxasset://textures/particles/explosion01_implosion_main.dds"
- PE5.Name = "PE5"
- PE5.Enabled = true
- PE5.LockedToPart = true
- -------------------------------------------------------
- --End Customization--
- -------------------------------------------------------
- if Rooted == false then
- Disable_Jump = false
- Humanoid.WalkSpeed = Speed
- elseif Rooted == true then
- Disable_Jump = true
- Humanoid.WalkSpeed = 0
- end
- sick.Parent = Torso
- sick:resume()
- sick.Volume = 5
- sick.Pitch = 1
- sick.SoundId = "rbxassetid://924339757"
- sick.Name = "BanishV3Music"
- end
- --//=================================\\
- --\\=================================//
- 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 Humanoid = waitForChild(Figure, "Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local runAnimTrack = nil
- local runAnimKeyframeHandler = nil
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=2931307441", weight = 1 },
- { id = "http://www.roblox.com/asset/?id=2931307441", weight = 1 },
- { id = "http://www.roblox.com/asset/?id=2931307441", weight = 9 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=2931337035", weight = 10 }
- },
- run = {
- { id = "http://www.roblox.com/asset/?id=2931337035", weight = 10 }
- },
- swim = {
- { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
- },
- swimidle = {
- { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
- },
- dance = {
- { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
- },
- }
- -- 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, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- math.randomseed(tick())
- 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.31
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.2
- -- 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
- -- clean up walk if there is one
- if (runAnimKeyframeHandler ~= nil) then
- runAnimKeyframeHandler:disconnect()
- end
- if (runAnimTrack ~= nil) then
- runAnimTrack:Stop()
- runAnimTrack:Destroy()
- runAnimTrack = nil
- end
- return oldAnim
- end
- local smallButNotZero = 0.0001
- function setRunSpeed(speed)
- if speed < 0.33 then
- currentAnimTrack:AdjustWeight(1.0)
- runAnimTrack:AdjustWeight(smallButNotZero)
- elseif speed < 0.66 then
- local weight = ((speed - 0.33) / 0.33)
- currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
- runAnimTrack:AdjustWeight(weight + smallButNotZero)
- else
- currentAnimTrack:AdjustWeight(smallButNotZero)
- runAnimTrack:AdjustWeight(1.0)
- end
- local speedScaled = speed * 1.25
- runAnimTrack:AdjustSpeed(speedScaled)
- currentAnimTrack:AdjustSpeed(speedScaled)
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- if currentAnim == "walk" then
- setRunSpeed(speed)
- else
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- end
- function keyFrameReachedFunc(frameName)
- -- print("CurrentAnim ", currentAnim, " ", frameName)
- if (frameName == "End") then
- if currentAnim == "walk" then
- runAnimTrack.TimePosition = 0.0
- currentAnimTrack.TimePosition = 0.0
- else
- -- print("Keyframe : ".. frameName)
- 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.15, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- end
- function rollAnimation(animName)
- 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
- return idx
- end
- function playAnimation(animName, transitionTime, humanoid)
- local idx = rollAnimation(animName)
- -- 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
- if (runAnimTrack ~= nil) then
- runAnimTrack:Stop(transitionTime)
- runAnimTrack: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)
- -- check to see if we need to blend a walk/run animation
- if animName == "walk" then
- local runAnimName = "run"
- local runIdx = rollAnimation(runAnimName)
- runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
- runAnimTrack:Play(transitionTime)
- if (runAnimKeyframeHandler ~= nil) then
- runAnimKeyframeHandler:disconnect()
- end
- runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- 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 idx = rollAnimation(animName)
- -- 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
- local scale = 16.0
- playAnimation("walk", 0.1, Humanoid)
- setAnimationSpeed(speed / scale)
- pose = "Running"
- else
- if emoteNames[currentAnim] == nil then
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- local scale = 5.0
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / scale)
- 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 > 1.00 then
- local scale = 10.0
- playAnimation("swim", 0.4, Humanoid)
- setAnimationSpeed(speed / scale)
- pose = "Swimming"
- else
- playAnimation("swimidle", 0.4, Humanoid)
- 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 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 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
- 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
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
- local 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
- Game.Players.LocalPlayer.Chatted:connect(function(msg)
- local emote = ""
- if (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
- -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
- end)
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- -- loop to handle timed state transitions and tool animations
- while Figure.Parent~=nil do
- local _, time = wait(0.1)
- move(time)
- end
- --//====================================================\\--
- --|| END OF SCRIPT
- --\\====================================================//--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement