Advertisement
HenloMyDude

slapp animation testing pity fat

Aug 20th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.76 KB | None | 0 0
  1. --//====================================================\\--
  2. --|| teest
  3. --\\====================================================//--
  4.  
  5.  
  6. local CHARACTER = owner.Character
  7. local PLAYER = game:GetService('Players'):GetPlayerFromCharacter(CHARACTER)
  8. local HUM = CHARACTER.Humanoid
  9.  
  10. local ROOT = HUM.Torso
  11. local HEAD = CHARACTER.Head
  12. local TORSO = CHARACTER.Torso
  13. local RIGHTARM = CHARACTER["Right Arm"]
  14. local LEFTARM = CHARACTER["Left Arm"]
  15. local RIGHTLEG = CHARACTER["Right Leg"]
  16. local LEFTLEG = CHARACTER["Left Leg"]
  17. local ROOTJOINT = ROOT["RootJoint"]
  18. local NECK = TORSO["Neck"]
  19. local RIGHTSHOULDER = TORSO["Right Shoulder"]
  20. local LEFTSHOULDER = TORSO["Left Shoulder"]
  21. local RIGHTHIP = TORSO["Right Hip"]
  22. local LEFTHIP = TORSO["Left Hip"]
  23. local MOUSEPOS = ROOT.Position
  24.  
  25. ------------
  26.  
  27. IT = Instance.new
  28. CF = CFrame.new
  29. VT = Vector3.new
  30. RAD = math.rad
  31. C3 = Color3.new
  32. UD2 = UDim2.new
  33. BRICKC = BrickColor.new
  34. ANGLES = CFrame.Angles
  35. EULER = CFrame.fromEulerAnglesXYZ
  36. COS = math.cos
  37. ACOS = math.acos
  38. SIN = math.sin
  39. ASIN = math.asin
  40. ABS = math.abs
  41. MRANDOM = math.random
  42. FLOOR = math.floor
  43.  
  44. ------------
  45.  
  46.  
  47. if game:GetService("RunService"):IsClient()then error("Please run as a server script. Use h/ instead of hl/.")end;print("FE Compatibility: by WaverlyCole");InternalData = {}
  48. do
  49. script.Parent = owner.Character
  50. local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
  51. local function NewFakeEvent()
  52. local Bind = Instance.new("BindableEvent")
  53. local Fake;Fake = {Connections = {},
  54. fakeEvent=true;
  55. Connect=function(self,Func)
  56. Bind.Event:connect(Func)
  57. self.Connections[Bind] = true
  58. return setmetatable({Connected = true},{
  59. __index = function (self,Index)
  60. if Index:lower() == "disconnect" then
  61. return function() Fake.Connections[Bind] = false;self.Connected = false end
  62. end
  63. return Fake[Index]
  64. end;
  65. __tostring = function() return "Connection" end;
  66. })
  67. end}
  68. Fake.connect = Fake.Connect;return Fake;
  69. end
  70. local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
  71. local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
  72. local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
  73. self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
  74. end};ContextActionService.UnBindAction = ContextActionService.BindAction
  75. local function TriggerEvent(self,Event,...)
  76. local Trigger = Mouse[Event]
  77. if Trigger and Trigger.fakeEvent and Trigger.Connections then
  78. for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end
  79. end
  80. end
  81. Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent
  82. Event.OnServerEvent:Connect(function(FiredBy,Input)
  83. if FiredBy.Name ~= owner.Name then return end
  84. if Input.MouseEvent then
  85. Mouse.Target = Input.Target;Mouse.Hit = Input.Hit
  86. else
  87. local Begin = Input.UserInputState == Enum.UserInputState.Begin
  88. if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end
  89. for _,Action in pairs(ContextActionService.Actions) do
  90. for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end
  91. end
  92. Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower())
  93. UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false)
  94. end
  95. end)
  96. InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService
  97. Event.Parent = NLS([[
  98. local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
  99. local Input = function(Input,gameProcessedEvent)
  100. if gameProcessedEvent then return end
  101. Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
  102. end
  103. UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input)
  104. local Hit,Target
  105. while wait(1/30) do
  106. if Hit ~= Mouse.Hit or Target ~= Mouse.Target then
  107. Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
  108. end
  109. end
  110. ]],owner.Character)
  111. end
  112. RealGame = game;game = setmetatable({},{
  113. __index = function (self,Index)
  114. local Sandbox = function (Thing)
  115. if Thing:IsA("Player") then
  116. local RealPlayer = Thing
  117. return setmetatable({},{
  118. __index = function (self,Index)
  119. local Type = type(RealPlayer[Index])
  120. if Type == "function" then
  121. if Index:lower() == "getmouse" or Index:lower() == "mouse" then
  122. return function (self)return InternalData["Mouse"] end
  123. end
  124. return function (self,...)return RealPlayer[Index](RealPlayer,...) end
  125. end
  126. return RealPlayer[Index]
  127. end;
  128. __tostring = function(self) return RealPlayer.Name end
  129. })
  130. end
  131. end
  132. if RealGame[Index] then
  133. local Type = type(RealGame[Index])
  134. if Type == "function" then
  135. if Index:lower() == "getservice" or Index:lower() == "service" then
  136. return function (self,Service)
  137. local FakeServices = {
  138. ["players"] = function()
  139. return setmetatable({},{
  140. __index = function (self2,Index2)
  141. local RealService = RealGame:GetService(Service)
  142. local Type2 = type(Index2)
  143. if Type2 == "function" then
  144. return function (self,...) return RealService[Index2](RealService,...)end
  145. else
  146. if Index2:lower() == "localplayer" then return Sandbox(owner) end
  147. return RealService[Index2]
  148. end
  149. end;
  150. __tostring = function(self) return RealGame:GetService(Service).Name end
  151. })
  152. end;
  153. ["contextactionservice"] = function() return InternalData["ContextActionService"] end;
  154. ["userinputservice"] = function() return InternalData["UserInputService"] end;
  155. ["runservice"] = function()
  156. return setmetatable({},{
  157. __index = function(self2,Index2)
  158. local RealService = RealGame:GetService(Service)
  159. local Type2 = type(Index2)
  160. if Type2 == "function" then
  161. return function (self,...) return RealService[Index2](RealService,...) end
  162. else
  163. local RunServices = {
  164. ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
  165. ["renderstepped"] = function() return RealService["Stepped"] end
  166. }
  167. if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end
  168. return RealService[Index2]
  169. end
  170. end
  171. })
  172. end
  173. }
  174. if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end
  175. return RealGame:GetService(Service)
  176. end
  177. end
  178. return function (self,...) return RealGame[Index](RealGame,...) end
  179. else
  180. if game:GetService(Index) then return game:GetService(Index) end
  181. return RealGame[Index]
  182. end
  183. end
  184. return nil
  185. end
  186. });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("Complete! Running...")
  187.  
  188.  
  189. ------------
  190.  
  191. local ANIM = "Idle"
  192. local ANIM_SPEED = 3
  193. local FRAME_SPEED = 1 / 60 -- (1 / 30) OR (1 / 60)
  194. local CHANGE = 2 / ANIM_SPEED
  195. local DAMAGEMULTIPLIER = 1
  196. local KEYHOLD = false
  197. local MOUSEHOLD = false
  198. local SINE = 0
  199. local ATTACKING = false
  200. local Debris = game:GetService("Debris")
  201. local Effects = IT("Folder",CHARACTER)
  202. Effects.Name = "FXFolder"
  203. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  204. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  205. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  206. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  207. if HUM:FindFirstChild("Animator") then
  208. HUM:FindFirstChild("Animator"):Destroy()
  209. end
  210.  
  211. ------------
  212.  
  213. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  214. local NEWPART = IT("Part")
  215. NEWPART.formFactor = FORMFACTOR
  216. NEWPART.Reflectance = REFLECTANCE
  217. NEWPART.Transparency = TRANSPARENCY
  218. NEWPART.CanCollide = false
  219. NEWPART.Locked = true
  220. NEWPART.Anchored = true
  221. if ANCHOR == false then
  222. NEWPART.Anchored = false
  223. end
  224. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  225. NEWPART.Name = NAME
  226. NEWPART.Size = SIZE
  227. NEWPART.Position = ROOT.Position
  228. NEWPART.Material = MATERIAL
  229. NEWPART:BreakJoints()
  230. NEWPART.Parent = PARENT
  231. return NEWPART
  232. end
  233.  
  234. function WeldParts(A,B)
  235. local WLD = IT("ManualWeld")
  236. WLD.Part0 = A
  237. WLD.Part1 = B
  238. WLD.C1 = B.CFrame:inverse() * A.CFrame
  239. WLD.Parent = A
  240. return WLD
  241. end
  242.  
  243. ----------------
  244.  
  245. ArtificialHB = Instance.new("BindableEvent", script)
  246. ArtificialHB.Name = "ArtificialHB"
  247.  
  248. script:WaitForChild("ArtificialHB")
  249.  
  250. frame = FRAME_SPEED
  251. tf = 0
  252. allowframeloss = false
  253. tossremainder = false
  254. lastframe = tick()
  255. script.ArtificialHB:Fire()
  256.  
  257. game:GetService("RunService").Heartbeat:connect(function(s, p)
  258. tf = tf + s
  259. if tf >= frame then
  260. if allowframeloss then
  261. ArtificialHB:Fire()
  262. lastframe = tick()
  263. else
  264. for i = 1, math.floor(tf / frame) do
  265. ArtificialHB:Fire()
  266. end
  267. lastframe = tick()
  268. end
  269. if tossremainder then
  270. tf = 0
  271. else
  272. tf = tf - frame * math.floor(tf / frame)
  273. end
  274. end
  275. end)
  276.  
  277. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  278. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  279. end
  280.  
  281.  
  282. function QuaternionFromCFrame(cf)
  283. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  284. local trace = m00 + m11 + m22
  285. if trace > 0 then
  286. local s = math.sqrt(1 + trace)
  287. local recip = 0.5 / s
  288. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  289. else
  290. local i = 0
  291. if m11 > m00 then
  292. i = 1
  293. end
  294. if m22 > (i == 0 and m00 or m11) then
  295. i = 2
  296. end
  297. if i == 0 then
  298. local s = math.sqrt(m00 - m11 - m22 + 1)
  299. local recip = 0.5 / s
  300. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  301. elseif i == 1 then
  302. local s = math.sqrt(m11 - m22 - m00 + 1)
  303. local recip = 0.5 / s
  304. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  305. elseif i == 2 then
  306. local s = math.sqrt(m22 - m00 - m11 + 1)
  307. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  308. end
  309. end
  310. end
  311.  
  312. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  313. local xs, ys, zs = x + x, y + y, z + z
  314. local wx, wy, wz = w * xs, w * ys, w * zs
  315. local xx = x * xs
  316. local xy = x * ys
  317. local xz = x * zs
  318. local yy = y * ys
  319. local yz = y * zs
  320. local zz = z * zs
  321. 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))
  322. end
  323.  
  324. function QuaternionSlerp(a, b, t)
  325. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  326. local startInterp, finishInterp;
  327. if cosTheta >= 0.0001 then
  328. if (1 - cosTheta) > 0.0001 then
  329. local theta = ACOS(cosTheta)
  330. local invSinTheta = 1 / SIN(theta)
  331. startInterp = SIN((1 - t) * theta) * invSinTheta
  332. finishInterp = SIN(t * theta) * invSinTheta
  333. else
  334. startInterp = 1 - t
  335. finishInterp = t
  336. end
  337. else
  338. if (1 + cosTheta) > 0.0001 then
  339. local theta = ACOS(-cosTheta)
  340. local invSinTheta = 1 / SIN(theta)
  341. startInterp = SIN((t - 1) * theta) * invSinTheta
  342. finishInterp = SIN(t * theta) * invSinTheta
  343. else
  344. startInterp = t - 1
  345. finishInterp = t
  346. end
  347. end
  348. 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
  349. end
  350.  
  351. function Clerp(a, b, t)
  352. local qa = {QuaternionFromCFrame(a)}
  353. local qb = {QuaternionFromCFrame(b)}
  354. local ax, ay, az = a.x, a.y, a.z
  355. local bx, by, bz = b.x, b.y, b.z
  356. local _t = 1 - t
  357. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  358. end
  359.  
  360. function Swait(NUMBER)
  361. if NUMBER == 0 or NUMBER == nil then
  362. ArtificialHB.Event:wait()
  363. else
  364. for i = 1, NUMBER do
  365. ArtificialHB.Event:wait()
  366. end
  367. end
  368. end
  369.  
  370. ATTACKING = false
  371. HUM.WalkSpeed = 16
  372.  
  373. function NewSound(TABLE)
  374. local ID = "rbxassetid://"..(TABLE.ID or 0)
  375. local PARENT = (TABLE.PARENT or ROOT)
  376. local VOLUME = (TABLE.VOLUME or 0.5)
  377. local PITCH = (TABLE.PITCH or 1)
  378. local LOOP = (TABLE.LOOP or false)
  379. local MAXDISTANCE = (TABLE.MAXDISTANCE or 100)
  380. local EMITTERSIZE = (TABLE.EMITTERSIZE or 10)
  381. local PLAYING = (TABLE.PLAYING or true)
  382. local PLAYONREMOVE = (TABLE.PLAYONREMOVE or false)
  383. local DOESDEBRIS = (TABLE.DOESDEBRIS or true)
  384. if ID ~= "rbxassetid://0" then
  385. local SOUND = IT("Sound",PARENT)
  386. SOUND.SoundId = ID
  387. SOUND.Volume = VOLUME
  388. SOUND.Pitch = PITCH
  389. SOUND.Looped = LOOP
  390. SOUND.MaxDistance = MAXDISTANCE
  391. SOUND.EmitterSize = EMITTERSIZE
  392. SOUND.PlayOnRemove = PLAYONREMOVE
  393. if DOESDEBRIS == true and PLAYING == true and LOOP == false then
  394. Debris:AddItem(SOUND,SOUND.TimeLength+5)
  395. end
  396. if PLAYING == true then
  397. SOUND:Play()
  398. end
  399. return SOUND
  400. end
  401. end
  402.  
  403. ---------------
  404.  
  405. function WHATSTHIS()
  406. ATTACKING = true
  407. NewSound({ID = 2820730608,PARENT = ROOT,VOLUME = 10,PITCH = 1,LOOP = false,MAXDISTANCE = 125,EMITTERSIZE = 100,PLAYING = false,PLAYONREMOVE = false,DOESDEBRIS = false})
  408. for i=0, 1.6, 0.1 / ANIM_SPEED do
  409. Swait()
  410. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  411. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  412. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0, 0) * ANGLES(RAD(180), RAD(0), RAD(-10)) * RIGHTSHOULDERC0, 1.5 / ANIM_SPEED)
  413. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0, 0) * ANGLES(RAD(180), RAD(0), RAD(10)) * LEFTSHOULDERC0, 1.5 / ANIM_SPEED)
  414. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  415. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  416. end
  417.  
  418. for i=0, 1.2, 0.1 / ANIM_SPEED do
  419. Swait()
  420. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  421. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  422. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0, 0) * ANGLES(RAD(120), RAD(0), RAD(-10)) * RIGHTSHOULDERC0, 1.5 / ANIM_SPEED)
  423. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0, 0) * ANGLES(RAD(120), RAD(0), RAD(10)) * LEFTSHOULDERC0, 1.5 / ANIM_SPEED)
  424. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  425. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  426. end
  427.  
  428. for i=0, 1.2, 0.1 / ANIM_SPEED do
  429. Swait()
  430. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  431. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.5 / ANIM_SPEED)
  432. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0, 0) * ANGLES(RAD(90), RAD(0), RAD(-10)) * RIGHTSHOULDERC0, 1.5 / ANIM_SPEED)
  433. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0, 0) * ANGLES(RAD(90), RAD(0), RAD(10)) * LEFTSHOULDERC0, 1.5 / ANIM_SPEED)
  434. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  435. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  436. end
  437. ATTACKING = false
  438. end
  439.  
  440. ---------------
  441.  
  442. local mouse = owner:GetMouse()
  443.  
  444. mouse.KeyDown:connect(function(key)
  445. key=key:lower()
  446. if key == "e" then
  447. if ATTACKING == false then
  448. WHATSTHIS()
  449. end
  450. end
  451. end)
  452.  
  453. ---------------
  454. while true do
  455. Swait()
  456. SINE = SINE + CHANGE
  457. if CHARACTER:FindFirstChild("Animate") then
  458. CHARACTER:FindFirstChild("Animate"):Destroy()
  459. end
  460. if CHARACTER:FindFirstChild("Sound") then
  461. CHARACTER:FindFirstChild("Sound"):Destroy()
  462. end
  463. if CHARACTER:FindFirstChild("Health") then
  464. CHARACTER:FindFirstChild("Health"):Destroy()
  465. end
  466. for _,v in next, HUM:GetPlayingAnimationTracks() do
  467. v:Stop();
  468. end
  469. local TORSOVELOCITY = (ROOT.Velocity * VT(1, 0, 1)).magnitude
  470. local TORSOVERTICALVELOCITY = ROOT.Velocity.y
  471. local HITFLOOR = Raycast(ROOT.Position, (CF(ROOT.Position, ROOT.Position + VT(0, -1, 0))).lookVector, 4+HUM.HipHeight, CHARACTER)
  472. local WALKSPEEDVALUE = 5-(1*(HUM.WalkSpeed/16))
  473. if WALKSPEEDVALUE <= 1 then
  474. WALKSPEEDVALUE = 1
  475. end
  476. local SITTING = HUM.Sit
  477. local ADD = HUM.WalkSpeed*2
  478. if ANIM == "Walk" and TORSOVELOCITY > 1 and ATTACKING == false and SITTING == false then
  479. ROOTJOINT.C1 = Clerp(ROOTJOINT.C1, ROOTC0 * CF(0, 0, -0.05 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - ROOT.RotVelocity.Y / 35, RAD(0)), 2 * (HUM.WalkSpeed / 16) / ANIM_SPEED)
  480. 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 * (HUM.WalkSpeed / 16) / ANIM_SPEED)
  481. RIGHTHIP.C1 = Clerp(RIGHTHIP.C1, CF(0.5, 0.875 - 0.3 * SIN(SINE / WALKSPEEDVALUE), -0.5 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RIGHTLEG.RotVelocity.Y / 35, RAD(0), RAD((35+ADD) * COS(SINE / WALKSPEEDVALUE))), 0.6 / ANIM_SPEED)
  482. LEFTHIP.C1 = Clerp(LEFTHIP.C1, CF(-0.5, 0.875 + 0.3 * SIN(SINE / WALKSPEEDVALUE), 0.5 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LEFTLEG.RotVelocity.Y / 35, RAD(0), RAD((35+ADD) * COS(SINE / WALKSPEEDVALUE))), 0.6 / ANIM_SPEED)
  483. elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) or ATTACKING == true or SITTING == true then
  484. ROOTJOINT.C1 = Clerp(ROOTJOINT.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / ANIM_SPEED)
  485. 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 / ANIM_SPEED)
  486. 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 / ANIM_SPEED)
  487. 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 / ANIM_SPEED)
  488. end
  489. if SITTING == false then
  490. if HITFLOOR then
  491. if TORSOVELOCITY < 1 and HITFLOOR ~= nil then
  492. ANIM = "Idle"
  493. if ATTACKING == false then
  494. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 24)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  495. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(10 - 2.5 * COS(SINE / 24)), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  496. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0.5, -0.75) * ANGLES(RAD(90), RAD(0), RAD(56)) * RIGHTSHOULDERC0, 0.5 / ANIM_SPEED)
  497. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-5), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.5 / ANIM_SPEED)
  498. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  499. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1 - 0.05 * COS(SINE / 24), -0.01) * ANGLES(RAD(0), RAD(-80), RAD(0)) * ANGLES(RAD(1), RAD(0), RAD(0)), 0.5 / ANIM_SPEED)
  500. end
  501. elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
  502. ANIM = "Walk"
  503. if ATTACKING == false then
  504. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, -0.05) * ANGLES(RAD(HUM.WalkSpeed/2), RAD(0), RAD(15*COS(SINE / WALKSPEEDVALUE))), 0.25 / ANIM_SPEED)
  505. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-HUM.WalkSpeed/2 - 2 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(-15*COS(SINE / WALKSPEEDVALUE))), 0.25 / ANIM_SPEED)
  506. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0.5, 0) * ANGLES(RAD((3+(ADD*1.25)) * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(-22 * COS(SINE / (WALKSPEEDVALUE/2)))) * RIGHTSHOULDERC0, 0.75 / ANIM_SPEED)
  507. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-(3+(ADD*1.25)) * COS(SINE / WALKSPEEDVALUE)), RAD(0), RAD(22 * COS(SINE / (WALKSPEEDVALUE/2)))) * LEFTSHOULDERC0, 0.75 / ANIM_SPEED)
  508. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(90-5*COS(SINE / WALKSPEEDVALUE)), RAD(0)) * ANGLES(RAD(-2), RAD(0), RAD(-15)), 0.25 / ANIM_SPEED)
  509. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90-5*COS(SINE / WALKSPEEDVALUE)), RAD(0)) * ANGLES(RAD(-2), RAD(0), RAD(15)), 0.25 / ANIM_SPEED)
  510. end
  511. end
  512. else
  513. if TORSOVERTICALVELOCITY > 0 then
  514. ANIM = "Jump"
  515. if ATTACKING == false then
  516. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / ANIM_SPEED)
  517. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / ANIM_SPEED)
  518. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0.35, 0) * ANGLES(RAD(-5), RAD(0), RAD(-10)) * RIGHTSHOULDERC0, 0.5 / ANIM_SPEED)
  519. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0.35, 0) * ANGLES(RAD(-5), RAD(0), RAD(10)) * LEFTSHOULDERC0, 0.5 / ANIM_SPEED)
  520. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -0.5, -0.5) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-20)), 1 / ANIM_SPEED)
  521. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.5 / ANIM_SPEED)
  522. end
  523. else
  524. ANIM = "Fall"
  525. if ATTACKING == false then
  526. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / ANIM_SPEED)
  527. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(20), RAD(0), RAD(0)), 0.2 / ANIM_SPEED)
  528. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0.55, 0) * ANGLES(RAD(-5), RAD(0), RAD(80)) * RIGHTSHOULDERC0, 0.5 / ANIM_SPEED)
  529. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0.55, 0) * ANGLES(RAD(-5), RAD(0), RAD(-80)) * LEFTSHOULDERC0, 0.5 / ANIM_SPEED)
  530. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -0.5, -0.5) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.8 / ANIM_SPEED)
  531. 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 / ANIM_SPEED)
  532. end
  533. end
  534. end
  535. else
  536. ANIM = "Sit"
  537. if ATTACKING == false then
  538. ROOTJOINT.C0 = Clerp(ROOTJOINT.C0,ROOTC0 * CF(0, 0, -0.5) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.25 / ANIM_SPEED)
  539. NECK.C0 = Clerp(NECK.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1.25 / ANIM_SPEED)
  540. RIGHTSHOULDER.C0 = Clerp(RIGHTSHOULDER.C0, CF(1.5, 0.65, 0) * ANGLES(RAD(50), RAD(10), RAD(-45))*CF(0,-0.25,0) * RIGHTSHOULDERC0, 1.25 / ANIM_SPEED)
  541. LEFTSHOULDER.C0 = Clerp(LEFTSHOULDER.C0, CF(-1.5, 0.65, 0) * ANGLES(RAD(50), RAD(-10), RAD(45))*CF(0,-0.25,0) * LEFTSHOULDERC0, 1.25 / ANIM_SPEED)
  542. RIGHTHIP.C0 = Clerp(RIGHTHIP.C0, CF(1, -0.25, -1) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 1.25 / ANIM_SPEED)
  543. LEFTHIP.C0 = Clerp(LEFTHIP.C0, CF(-1, -0.25, -1) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-10)), 1.25 / ANIM_SPEED)
  544. end
  545. end
  546. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement