Guest User

cool walking animation

a guest
May 13th, 2018
1,020
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.77 KB | None | 0 0
  1. local model = game:GetService("Players").LocalPlayer.Character
  2. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  3. local Torso = model.Torso
  4. local RS = Torso:FindFirstChild("Right Shoulder")
  5. local LS = Torso:FindFirstChild("Left Shoulder")
  6. local RH = Torso:FindFirstChild("Right Hip")
  7. local LH = Torso:FindFirstChild("Left Hip")
  8. local Neck = Torso:FindFirstChild("Neck")
  9. local Torso = model.Torso
  10. local Head = model.Head
  11. model.Humanoid.MaxHealth = 500000000000
  12. model.Humanoid.Health = 500000000000
  13. local Humanoid = model.Humanoid
  14. local LeftArm = model["Left Arm"]
  15. local LeftLeg = model["Left Leg"]
  16. local RightArm = model["Right Arm"]
  17. local RightLeg = model["Right Leg"]
  18. local RootPart = model.HumanoidRootPart
  19. local attack = false
  20. local idle = 0
  21. local Gen = "Boy"
  22. local ToolMode = 1
  23. local sprintmode=false
  24. local jp = 50
  25. local ws = 8
  26. local inAir=true
  27. local inAir2=true
  28. local equipped = true
  29. local MoveTH = true
  30. local MoveArms = true
  31. local MoveLegs = true
  32. local toolAon = false
  33. local stopTA = false
  34. local sine = 0
  35. local change = 1
  36. local toolAnim = "None"
  37. local toolAnimTime = 0
  38. local Anim="Idle"
  39. local RJ = model.HumanoidRootPart:FindFirstChild("RootJoint")
  40. local cn = CFrame.new
  41. local cf = CFrame.new
  42. local ca2 = CFrame.Angles
  43. local mf = math.floor
  44. local RbxUtility = LoadLibrary("RbxUtility")
  45. local Create = RbxUtility.Create
  46. local canstoptuant1 = false
  47. local stoptuant1 = false
  48. local MenyOpen = false
  49. function swait(num)
  50. if num == 0 or num == nil then
  51. game:service'RunService'.RenderStepped:wait(0)
  52. else
  53. for i = 0, num do
  54. game:service'RunService'.RenderStepped:wait(0)
  55. end
  56. end
  57. end
  58.  
  59. function stopAnimations()
  60. coroutine.resume(coroutine.create(function()
  61. model.Animate:Destroy()
  62. end))
  63. coroutine.resume(coroutine.create(function()
  64. for _,v in pairs(Humanoid:GetPlayingAnimationTracks()) do
  65. v:Stop()
  66.  
  67. end
  68. end))
  69. end
  70.  
  71.  
  72. stopAnimations()
  73. wait(.1)
  74.  
  75. rayCast = function(Pos, Dir, Max, Ignore)
  76.  
  77. return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  78. end
  79. RS.C1 = cn(0, 0.5, 0)
  80. LS.C1 = cn(0, 0.5, 0)
  81. RH.C1 = cn(0, 1, 0) *CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  82. LH.C1 = cn(0, 1, 0) *CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  83. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  84. local NeckCF = cn(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  85. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  86. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  87.  
  88.  
  89.  
  90.  
  91.  
  92. function RemoveOutlines(part)
  93. part.TopSurface, part.BottomSurface, part.LeftSurface, part.RightSurface, part.FrontSurface, part.BackSurface = 10, 10, 10, 10, 10, 10
  94. end
  95.  
  96.  
  97. CFuncs = {
  98. Part = {Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
  99.  
  100. local Part = Create("Part")({Parent = Parent, Reflectance = Reflectance, Transparency = Transparency, CanCollide = false, Locked = true, BrickColor = BrickColor.new(tostring(BColor)), Name = Name, Size = Size, Material = Material})
  101. RemoveOutlines(Part)
  102. return Part
  103. end
  104. }
  105. ,
  106. Mesh = {Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  107.  
  108. local Msh = Create(Mesh)({Parent = Part, Offset = OffSet, Scale = Scale})
  109. if Mesh == "SpecialMesh" then
  110. Msh.MeshType = MeshType
  111. Msh.MeshId = MeshId
  112. end
  113. return Msh
  114. end
  115. }
  116. ,
  117. Mesh = {Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
  118.  
  119. local Msh = Create(Mesh)({Parent = Part, Offset = OffSet, Scale = Scale})
  120. if Mesh == "SpecialMesh" then
  121. Msh.MeshType = MeshType
  122. Msh.MeshId = MeshId
  123. end
  124. return Msh
  125. end
  126. }
  127. ,
  128. Weld = {Create = function(Parent, Part0, Part1, C0, C1)
  129.  
  130. local Weld = Create("Weld")({Parent = Parent, Part0 = Part0, Part1 = Part1, C0 = C0, C1 = C1})
  131. return Weld
  132. end
  133. }
  134. ,
  135. Sound = {Create = function(id, par, vol, pit)
  136.  
  137. coroutine.resume(coroutine.create(function()
  138.  
  139. local S = Create("Sound")({Volume = vol, Pitch = pit or 1, SoundId = "http://www.roblox.com/asset/?id="..id, Parent = par or workspace})
  140. wait()
  141. S:play()
  142. game:GetService("Debris"):AddItem(S, 6)
  143. end
  144. ))
  145. end
  146. }
  147. ,
  148.  
  149. Sound2 = {Create = function(id, par, vol, pit, SoundTime)
  150.  
  151. coroutine.resume(coroutine.create(function()
  152.  
  153. local S = Create("Sound")({Volume = vol, Pitch = pit or 1, SoundId = "http://www.roblox.com/asset/?id="..id, Parent = par or workspace})
  154. wait()
  155. S:play()
  156. game:GetService("Debris"):AddItem(S, SoundTime)
  157. end
  158. ))
  159. end
  160. }
  161. ,
  162. ParticleEmitter = {Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
  163.  
  164. local fp = Create("ParticleEmitter")({Parent = Parent, Color = ColorSequence.new(Color1, Color2), LightEmission = LightEmission, Size = Size, Texture = Texture, Transparency = Transparency, ZOffset = ZOffset, Acceleration = Accel, Drag = Drag, LockedToPart = LockedToPart, VelocityInheritance = VelocityInheritance, EmissionDirection = EmissionDirection, Enabled = Enabled, Lifetime = LifeTime, Rate = Rate, Rotation = Rotation, RotSpeed = RotSpeed, Speed = Speed, VelocitySpread = VelocitySpread})
  165. return fp
  166. end
  167. }
  168. }
  169.  
  170. so = function(id, par, vol, pit, AlTime)
  171.  
  172. if AlTime ~= nil then
  173.  
  174. CFuncs.Sound2.Create(id, par, vol, pit, AlTime)
  175.  
  176. else
  177. CFuncs.Sound.Create(id, par, vol, pit)
  178. end
  179.  
  180. end
  181.  
  182.  
  183.  
  184. local ParticEffect1 = Create("ParticleEmitter"){
  185. Color = ColorSequence.new(Color3.new (1, 1, 1), Color3.new (0, 0, 0)),
  186. Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(0.2,0),NumberSequenceKeypoint.new(1,1)}),
  187. Size = NumberSequence.new({NumberSequenceKeypoint.new(0,.15),NumberSequenceKeypoint.new(0.5,.01),NumberSequenceKeypoint.new(1,0)}),
  188. Texture = "rbxassetid://596872069",
  189. Lifetime = NumberRange.new(0.8),
  190. Rate = 100,
  191. VelocitySpread = 360,
  192. RotSpeed = NumberRange.new(-100,100),
  193. Speed = NumberRange.new(2),
  194. LightEmission = 1,
  195. LockedToPart = false,
  196. Acceleration = Vector3.new(0, -5, 0),
  197. EmissionDirection = "Back",
  198.  
  199. }
  200.  
  201. --[[
  202. fat = Instance.new("BindableEvent", script)
  203. fat.Name = "Heartbeat"
  204. script:WaitForChild("Heartbeat")
  205. frame = 1/30
  206. tf = 0
  207. allowframeloss = false
  208. tossremainder = false
  209. lastframe = tick()
  210. script.Heartbeat:Fire()
  211. game:GetService("RunService").Heartbeat:connect(function(s, p)
  212.  
  213. tf = tf + s
  214. if frame <= tf then
  215. if allowframeloss then
  216. script.Heartbeat:Fire()
  217. lastframe = tick()
  218. else
  219. for i = 1, math.floor(tf / frame) do
  220. script.Heartbeat:Fire()
  221. end
  222. lastframe = tick()
  223. end
  224. if tossremainder then
  225. tf = 0
  226. else
  227. tf = tf - frame * math.floor(tf / frame)
  228. end
  229. end
  230. end
  231. )
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247. --]]
  248.  
  249. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, true)
  250.  
  251.  
  252. for i = 1,3,.1 do
  253. swait()
  254. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),1)
  255. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, 0, -0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),1)
  256. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-0)),1)
  257. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),1)
  258. RH.C0 = RH.C0:lerp(CFrame.new(.5, -1, 0) * CFrame.Angles(math.rad(-0),math.rad(0),math.rad(0)),1)
  259. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -1, 0) * CFrame.Angles(math.rad(-0),math.rad(0),math.rad(0)),1)
  260.  
  261.  
  262.  
  263. end
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276. function JumpAfterEffect()
  277. if attack == false then
  278. attack = true
  279.  
  280. if RootPart.Velocity.y < -65 then
  281. Humanoid.WalkSpeed= 0
  282. Humanoid.JumpPower= 0
  283. for i = 1,3,.1 do
  284. swait()
  285. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(25-3 * math.cos(sine / 15)),math.rad(0),math.rad(0)),.1)
  286. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, .3, -.8 +-.05 * math.cos(sine / 15.5)) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  287. RS.C0 = RS.C0:lerp(CFrame.new(1.4, .7- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(25),math.rad(0),math.rad(20)),.1)
  288. LS.C0 = LS.C0:lerp(CFrame.new(-1.4, .7- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(25),math.rad(0),math.rad(-20)),.1)
  289. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.15+ .05 * math.cos(sine / 15), -.4) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  290. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.15+ .05 * math.cos(sine / 15), -.4) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  291.  
  292. end
  293.  
  294. else
  295. if sprintmode == true then
  296. Humanoid.WalkSpeed= 10
  297. else
  298. Humanoid.WalkSpeed= 3
  299. end
  300. Humanoid.JumpPower= 0
  301. for i = 1,2,.1 do
  302. swait()
  303. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(25-3 * math.cos(sine / 15)),math.rad(0),math.rad(0)),.1)
  304. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, .3, -.6 +-.05 * math.cos(sine / 15.5)) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(0)),.2)
  305. RS.C0 = RS.C0:lerp(CFrame.new(1.4, .7- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(25),math.rad(0),math.rad(20)),.1)
  306. LS.C0 = LS.C0:lerp(CFrame.new(-1.4, .7- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(25),math.rad(0),math.rad(-20)),.1)
  307. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.65+ .05 * math.cos(sine / 15), -.2) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  308. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.65+ .05 * math.cos(sine / 15), -.2) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0)),.2)
  309.  
  310. end
  311.  
  312. end
  313. attack = false
  314. end
  315. end
  316.  
  317.  
  318.  
  319. function SlashAnim()
  320. if toolAon == false then
  321. toolAon= true
  322. MoveArms = false
  323. for i = 1,2,.1 do
  324. if stopTA == false then
  325. swait()
  326. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.8- .03 * math.cos(sine / 20), -.2) * CFrame.Angles(math.rad(160- 1 * math.cos(sine / 20)),math.rad(-10),math.rad(5- 1 * math.cos(sine / 20))),.2)
  327. end
  328.  
  329.  
  330.  
  331. end
  332.  
  333. for i = 1,3,.1 do
  334. if stopTA == false then
  335. swait()
  336. RS.C0 = RS.C0:lerp(CFrame.new(1.3, 0.3- .03 * math.cos(sine / 20), -.2) * CFrame.Angles(math.rad(0- 1 * math.cos(sine / 20)),math.rad(10),math.rad(-20- 1 * math.cos(sine / 20))),.5)
  337.  
  338. end
  339.  
  340.  
  341. end
  342.  
  343. toolAnim = "None"
  344. toolAon = false
  345.  
  346.  
  347. end
  348. end
  349.  
  350.  
  351.  
  352. function LungeAnim()
  353. stopTA = true
  354. MoveArms = false
  355.  
  356. swait(10)
  357. if toolAon == false then
  358.  
  359. toolAon= true
  360.  
  361. for i = 1,3,.1 do
  362. toolAon= true
  363.  
  364. swait()
  365. RS.C0 = RS.C0:lerp(CFrame.new(1.4, 0.7- .03 * math.cos(sine / 20), -.2) * CFrame.Angles(math.rad(170- 1 * math.cos(sine / 20)),math.rad(0),math.rad(0- 1 * math.cos(sine / 20))),.1)
  366.  
  367.  
  368.  
  369.  
  370. end
  371.  
  372. for i = 1,2,.1 do
  373. swait()
  374. RS.C0 = RS.C0:lerp(CFrame.new(1.4, 0.5- .03 * math.cos(sine / 20), -.2) * CFrame.Angles(math.rad(30- 1 * math.cos(sine / 20)),math.rad(10),math.rad(-20- 1 * math.cos(sine / 20))),.2)
  375.  
  376.  
  377. toolAon= true
  378.  
  379. end
  380.  
  381.  
  382. toolAnim = "None"
  383. toolAon = false
  384. stopTA = false
  385. end
  386. end
  387.  
  388.  
  389.  
  390.  
  391. function getTool()
  392. for _, kid in ipairs(model:GetChildren()) do
  393. if kid.className == "Tool" then return kid end
  394. end
  395. return nil
  396. end
  397. function getToolAnim(tool)
  398. for _, c in ipairs(tool:GetChildren()) do
  399. if c.Name == "toolanim" and c.className == "StringValue" then
  400. return c
  401. end
  402. end
  403. return nil
  404. end
  405. function animateTool()
  406.  
  407. if (toolAnim == "None") then
  408. if ToolMode == 1 then
  409. RS.C0 = RS.C0:lerp(CFrame.new(1.4, 0.6- .03 * math.cos(sine / 20), -.2) * CFrame.Angles(math.rad(75- 1 * math.cos(sine / 20)),math.rad(20),math.rad(-15- 1 * math.cos(sine / 20))),.1)
  410. elseif ToolMode == 2 then
  411. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.55- .03 * math.cos(sine / 20), -.1) * CFrame.Angles(math.rad(90- 1 * math.cos(sine / 20)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 20))),.1)
  412. elseif ToolMode == 3 then
  413. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.6- .03 * math.cos(sine / 20), -.1) * CFrame.Angles(math.rad(90 - 1 * math.cos(sine / 20)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 20))),.1)
  414. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.6- .03 * math.cos(sine / 20), -.1) * CFrame.Angles(math.rad(90 - 1 * math.cos(sine / 20)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 20))),.1)
  415. elseif ToolMode == 4 then
  416. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 20), -.0) * CFrame.Angles(math.rad(0 - 1 * math.cos(sine / 20)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 20))),.1)
  417. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), -.0) * CFrame.Angles(math.rad(0 - 1 * math.cos(sine / 20)),math.rad(0),math.rad(0 - 1 * math.cos(sine / 20))),.1)
  418. elseif ToolMode == 5 then
  419. MoveArms = true
  420.  
  421.  
  422.  
  423. end
  424. return
  425. end
  426.  
  427. if (toolAnim == "Slash") then
  428. SlashAnim()
  429.  
  430. return
  431. end
  432.  
  433. if (toolAnim == "Lunge") then
  434. LungeAnim()
  435. return
  436. end
  437. end
  438.  
  439.  
  440.  
  441. game:GetService'RunService'.Stepped:connect(function()
  442.  
  443. sine = sine + change
  444.  
  445. local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
  446. local velderp = RootPart.Velocity.y
  447. hitfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, model)
  448.  
  449.  
  450. if sprintmode == true then
  451. jp = 60
  452. ws = 44
  453. else
  454. jp = 50
  455. ws = 8
  456. end
  457.  
  458. if hitfloor ~= nil then
  459. inAir = true
  460. else
  461. inAir = false
  462. end
  463.  
  464. if inAir == true then
  465. if inAir2 == false then
  466.  
  467.  
  468. JumpAfterEffect()
  469.  
  470. end
  471. end
  472.  
  473. if hitfloor ~= nil then
  474. inAir2 = true
  475. else
  476. inAir2 = false
  477. end
  478. --[
  479.  
  480. if RootPart.Velocity.y > 1 and hitfloor == nil then
  481. Anim = "Jump"
  482. elseif RootPart.Velocity.y < -1 and hitfloor == nil then
  483. Anim = "Fall"
  484. elseif Humanoid.Sit == true then
  485. Anim = "Sit"
  486. elseif torvel < 1 and hitfloor ~= nil then
  487. Anim = "Idle"
  488. elseif torvel > 2 and hitfloor ~= nil then
  489. if sprintmode == true then
  490. Anim = "Run"
  491. else
  492. Anim = "Walk"
  493. end
  494. else
  495. Anim = ""
  496.  
  497. end
  498.  
  499.  
  500.  
  501. --]]
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511. if attack == false then
  512. Humanoid.JumpPower=jp
  513. Humanoid.WalkSpeed=ws
  514.  
  515. local tool = getTool()
  516. if tool and tool:FindFirstChild("Handle") then
  517.  
  518. MoveArms = false
  519.  
  520. local animStringValueObject = getToolAnim(tool)
  521.  
  522. if animStringValueObject then
  523. toolAnim = animStringValueObject.Value
  524. -- message recieved, delete StringValue
  525. animStringValueObject.Parent = nil
  526.  
  527. end
  528.  
  529.  
  530.  
  531. animateTool()
  532.  
  533.  
  534. if ToolMode == 1 or ToolMode == 2 then
  535. if Anim == "Jump" then
  536. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(20 -1* math.cos(sine / 10)),math.rad(0),math.rad(-5)),.3)
  537. elseif Anim == "Fall" then
  538. LS.C0 = LS.C0:lerp(CFrame.new(-1.1, 1- .03 * math.cos(sine / 15), .3) * CFrame.Angles(math.rad(15 -1* math.cos(sine / 10)),math.rad(0),math.rad(-100)),.05)
  539. elseif Anim == "Idle" then
  540. if Gen == "Boy" then
  541. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-1+ 1 * math.cos(sine / 20))),.1)
  542. end
  543. if Gen == "Girl" then
  544. LS.C0 = LS.C0:lerp(CFrame.new(-1.25, 0.3- .03 * math.cos(sine / 26), .1) * CFrame.Angles(math.rad(6),math.rad(20),math.rad(23+ 0 * math.cos(sine / 25))),.1)
  545. end
  546. elseif Anim == "Sit" then
  547. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(-1+ 1 * math.cos(sine / 20))),.1)
  548. elseif Anim == "Walk" then
  549. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(-30 * math.cos(sine / 7)),math.rad(0),math.rad(0)),.1)
  550. elseif Anim == "Run" then
  551. LS.C0 = LS.C0:lerp(CFrame.new(-1.49, 0.6, 0) * CFrame.Angles(math.rad(10+75*math.cos(sine / 4)), math.rad(5+-35*math.cos(sine / 4)), math.rad(-2+10*math.cos(sine / 4))), .3)
  552. else
  553. LS.C0 = LS.C0:lerp(CFrame.new(-1.3, 0.8, 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-35)),.05)
  554. end
  555. end
  556.  
  557.  
  558. else
  559. MoveArms = true
  560. end
  561.  
  562.  
  563. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  564. if Anim == "Jump" then
  565. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  566. if MoveTH == true then
  567. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-15-3 * math.cos(sine / 15)),math.rad(0),math.rad(0)),.1)
  568. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, 0, 1.3 +-.05 * math.cos(sine / 15)) * CFrame.Angles(math.rad(-5),math.rad(0),math.rad(0)),.15)
  569. end
  570. if MoveArms == true then
  571. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(20 +1* math.cos(sine / 10)),math.rad(0),math.rad(5)),.3)
  572. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(20 -1* math.cos(sine / 10)),math.rad(0),math.rad(-5)),.3)
  573. end
  574. if MoveLegs == true then
  575. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.85+ .05 * math.cos(sine / 15), -.2) * CFrame.Angles(math.rad(-15 -1* math.cos(sine / 10)),math.rad(0),math.rad(0)),.1)
  576. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.35+ .05 * math.cos(sine / 15), -.4) * CFrame.Angles(math.rad(-25 +1* math.cos(sine / 10)),math.rad(0),math.rad(0)),.2)
  577. end
  578. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  579. elseif Anim == "Fall" then
  580. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  581. if MoveTH == true then
  582. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(25-3 * math.cos(sine / 15)),math.rad(0),math.rad(0)),.05)
  583. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, 0, -0.3 +-.05 * math.cos(sine / 15)) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(0)),.08)
  584. end
  585. if MoveArms == true then
  586. RS.C0 = RS.C0:lerp(CFrame.new(1.1, 1- .03 * math.cos(sine / 15), .3) * CFrame.Angles(math.rad(15 +1* math.cos(sine / 10)),math.rad(0),math.rad(100)),.05)
  587. LS.C0 = LS.C0:lerp(CFrame.new(-1.1, 1- .03 * math.cos(sine / 15), .3) * CFrame.Angles(math.rad(15 -1* math.cos(sine / 10)),math.rad(0),math.rad(-100)),.05)
  588. end
  589. if MoveLegs == true then
  590. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.15+ .05 * math.cos(sine / 15), -.4) * CFrame.Angles(math.rad(-15 -1* math.cos(sine / 10)),math.rad(0),math.rad(0)),.1)
  591. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.55+ .05 * math.cos(sine / 15), -.4) * CFrame.Angles(math.rad(-0 +1* math.cos(sine / 10)),math.rad(0),math.rad(0)),.1)
  592. end
  593. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  594. elseif Anim == "Sit" then
  595. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  596. if MoveTH == true then
  597. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(3+2 * math.cos(sine / 20)),math.rad(0),math.rad(0)),.1)
  598. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, 0, -.1 +-.03 * math.cos(sine / 20)) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),.15)
  599. end
  600. if MoveArms == true then
  601. if Gen == "Girl" then
  602. RS.C0 = RS.C0:lerp(CFrame.new(1.3, 0.3- .03 * math.cos(sine / 20), -.1) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(-30- 1 * math.cos(sine / 20))),.1)
  603. LS.C0 = LS.C0:lerp(CFrame.new(-1.3, 0.3- .03 * math.cos(sine / 20), -.1) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(30+ 1 * math.cos(sine / 20))),.1)
  604. end
  605. if Gen == "Boy" then
  606. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 20), -.0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(-0- 1 * math.cos(sine / 20))),.1)
  607. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), -.0) * CFrame.Angles(math.rad(10),math.rad(0),math.rad(0+ 1 * math.cos(sine / 20))),.1)
  608. end
  609.  
  610. end
  611. if MoveLegs == true then
  612. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.85+ .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(80),math.rad(0),math.rad(2.5- .1 * math.cos(sine / 20))),.15)
  613. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.85+ .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(80),math.rad(0),math.rad(-2.5+ .1 * math.cos(sine / 20))),.15)
  614. end
  615. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  616. elseif Anim == "Idle" then
  617. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  618. if Gen == "Girl" then
  619.  
  620. if MoveTH == true then
  621. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(3+2 * math.cos(sine / 25)),math.rad(-7 * math.cos(sine / 26)),math.rad(2 * math.cos(sine / 26))),.1)
  622. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(.07 * math.cos(sine / 26), 0, -.1 +-.03 * math.cos(sine / 25)) * CFrame.Angles(math.rad(0),math.rad(4 * math.cos(sine / 26)),math.rad(-3 * math.cos(sine / 26))),.15)
  623. end
  624. if MoveArms == true then
  625. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .01 * math.cos(sine / 25), 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(1- 2 * math.cos(sine / 26))),.1)
  626. LS.C0 = LS.C0:lerp(CFrame.new(-1.25, 0.3- .03 * math.cos(sine / 26), .1) * CFrame.Angles(math.rad(6),math.rad(20),math.rad(23+ 0 * math.cos(sine / 25))),.1)
  627. end
  628. if MoveLegs == true then
  629. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.95+ .03 * math.cos(sine / 25), .02) * CFrame.Angles(math.rad(-3),math.rad(0),math.rad(2.5- 0.0 * math.cos(sine / 25)))*CFrame.new(0, -.03 * math.cos(sine / 26), 0-0.03 * math.cos(sine / 26)) * CFrame.Angles(math.rad(0.5 * math.cos(sine / 26)),math.rad(2 * math.cos(sine / 26)),math.rad(-4 * math.cos(sine / 26))),.15)
  630. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.95+ .03 * math.cos(sine / 25), -.25) * CFrame.Angles(math.rad(-10),math.rad(0),math.rad(-2.5+ .1 * math.cos(sine / 25)))*CFrame.new(0, .03 * math.cos(sine / 26), 0) * CFrame.Angles(math.rad(-0 -2 * math.cos(sine / 26)),math.rad(-20 +2 * math.cos(sine / 26)),math.rad(-4 * math.cos(sine / 26))),.15)
  631. end
  632.  
  633. end
  634.  
  635.  
  636.  
  637.  
  638.  
  639. if Gen == "Boy" then
  640. if MoveTH == true then
  641. Neck.C0 = Neck.C0:lerp(NeckCF*CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(3+2 * math.cos(sine / 20)),math.rad(0),math.rad(0)),.1)
  642. RJ.C0 = RJ.C0:lerp(RootCF*CFrame.new(0, 0, -.1 +-.03 * math.cos(sine / 20)) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),.15)
  643. end
  644. if MoveArms == true then
  645. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(1- 1 * math.cos(sine / 20))),.1)
  646. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-1+ 1 * math.cos(sine / 20))),.1)
  647. end
  648. if MoveLegs == true then
  649. RH.C0 = RH.C0:lerp(CFrame.new(.5, -0.95+ .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(-0),math.rad(0),math.rad(2.5- .1 * math.cos(sine / 20))),.15)
  650. LH.C0 = LH.C0:lerp(CFrame.new(-.5, -0.95+ .03 * math.cos(sine / 20), 0) * CFrame.Angles(math.rad(-0),math.rad(0),math.rad(-2.5+ .1 * math.cos(sine / 20))),.15)
  651. end
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659. end
  660.  
  661. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  662. elseif Anim == "Walk" then
  663. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  664. if Gen == "Girl" then
  665.  
  666. if MoveTH == true then
  667. Neck.C0 = Neck.C0:lerp(NeckCF * cf(0, 0, 0 + 0.025 * math.cos(sine / 3.5)) * CFrame.Angles(math.rad(0 - 1.5 * math.cos(sine / 3.5)), math.rad(5.5 * math.cos(sine / 7) ), math.rad(-7.5 * math.cos(sine / 7)) + RootPart.RotVelocity.Y / 14), 0.15)
  668. RJ.C0 = RJ.C0:lerp(RootCF * cf(0, 0, -0.075 + 0.025 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7) * CFrame.Angles(math.rad(3 - 2.5 * math.cos(sine / 3.5)), math.rad(-5 * math.cos(sine / 7)), math.rad(10 * math.cos(sine / 7))), 0.15)
  669. end
  670. if MoveArms == true then
  671. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(30 * math.cos(sine / 7)),math.rad(0),math.rad(4 * math.cos(sine / 7))),.1)
  672. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(-30 * math.cos(sine / 7)),math.rad(0),math.rad(4 * math.cos(sine / 7))),.1)
  673. end
  674. if MoveLegs == true then
  675. RH.C0 = RH.C0:lerp( cf(.5, -0.925 - 0.5 * math.cos(sine / 7) / 2,-0.1+ 0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-7.5 - 15 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(-90), math.rad(5 * math.cos(sine / 7))), 0.15)
  676. LH.C0 = LH.C0:lerp( cf(-.5, -0.925 + 0.5 * math.cos(sine / 7) / 2,-0.1+ -0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-7.5 + 15 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(90), math.rad(5 * math.cos(sine / 7))), 0.15)
  677. end
  678.  
  679. end
  680.  
  681.  
  682. if Gen == "Boy" then
  683. if MoveTH == true then
  684. Neck.C0 = Neck.C0:lerp(NeckCF * cf(0, 0, 0 + 0.025 * math.cos(sine / 3.5)) * CFrame.Angles(math.rad(0 - 1.5 * math.cos(sine / 3.5)), math.rad(1.5 * math.cos(sine / 7) ), math.rad(-7.5 * math.cos(sine / 7)) + RootPart.RotVelocity.Y / 14), 0.15)
  685. RJ.C0 = RJ.C0:lerp(RootCF * cf(0, 0, -0.075 + 0.025 * math.cos(sine / 3.5) + -math.sin(sine / 3.5) / 7) * CFrame.Angles(math.rad(3 - 2.5 * math.cos(sine / 3.5)), math.rad(0), math.rad(10 * math.cos(sine / 7))), 0.15)
  686. end
  687. if MoveArms == true then
  688. RS.C0 = RS.C0:lerp(CFrame.new(1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(30 * math.cos(sine / 7)),math.rad(0),math.rad(-0)),.1)
  689. LS.C0 = LS.C0:lerp(CFrame.new(-1.5, 0.5- .03 * math.cos(sine / 15), 0) * CFrame.Angles(math.rad(-30 * math.cos(sine / 7)),math.rad(0),math.rad(0)),.1)
  690. end
  691. if MoveLegs == true then
  692. RH.C0 = RH.C0:lerp( cf(.5, -0.925 - 0.5 * math.cos(sine / 7) / 2,-0.1+ 0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-7.5 - 15 * math.cos(sine / 7)) + -math.sin(sine / 7) / 2.5, math.rad(90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 + 2.5 * math.cos(sine / 7)), math.rad(-90), math.rad(0)), 0.15)
  693. LH.C0 = LH.C0:lerp( cf(-.5, -0.925 + 0.5 * math.cos(sine / 7) / 2,-0.1+ -0.5 * math.cos(sine / 7) / 2) * CFrame.Angles(math.rad(-7.5 + 15 * math.cos(sine / 7)) + math.sin(sine / 7) / 2.5, math.rad(-90 - 10 * math.cos(sine / 7)), math.rad(0)) * CFrame.Angles(math.rad(0 - 2.5 * math.cos(sine / 7)), math.rad(90), math.rad(0)), 0.15)
  694. end
  695. end
  696. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  697. elseif Anim == "Run" then
  698. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  699.  
  700. if MoveTH == true then
  701. Neck.C0 = Neck.C0:lerp(NeckCF * CFrame.Angles(math.rad(-3), math.rad(0), math.rad(-8.5 * math.cos(sine / 4)) + RootPart.RotVelocity.Y / 14), .3)
  702. RJ.C0 = RJ.C0:lerp(RootCF * cf(0, 0, -0.1 + 0.15 * math.cos(sine / 3)) * CFrame.Angles(math.rad(15), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(10 * math.cos(sine / 4))), .4)
  703. end
  704. if MoveArms == true then
  705. RS.C0 = RS.C0:lerp(CFrame.new(1.49, 0.62, .3*math.cos(sine / 4)) * CFrame.Angles(math.rad(10+-75*math.cos(sine / 4)), math.rad(5+-35*math.cos(sine / 4)), math.rad(2+10*math.cos(sine / 4))), .3)
  706. LS.C0 = LS.C0:lerp(CFrame.new(-1.49, 0.62, -.3*math.cos(sine / 4)) * CFrame.Angles(math.rad(10+75*math.cos(sine / 4)), math.rad(5+-35*math.cos(sine / 4)), math.rad(-2+10*math.cos(sine / 4))), .3)
  707. end
  708. if MoveLegs == true then
  709. RH.C0 = RH.C0:lerp( cf(.5, -1.0 - -0.3 * math.cos(sine / 4), -.1 - 0.1 * math.cos(sine / 4)) * CFrame.Angles(math.rad(-10 + 50 * math.cos(sine / 4)), math.rad(0), math.rad(2)), .4)
  710. LH.C0 = LH.C0:lerp( cf(-.5, -1.0 + -0.3 * math.cos(sine / 4), -.1 + 0.1 * math.cos(sine / 4)) * CFrame.Angles(math.rad(10 -50 * math.cos(sine / 4)), math.rad(0), math.rad(-2)), .4)
  711. end
  712.  
  713.  
  714. --[[
  715.  
  716. RootJoint.C0 = clerp(RootJoint.C0, RootCF * cn(0, 0, -0.1 + 0.15 * math.cos(sine / 3)) * angles(math.rad(15), math.rad(0) + RootPart.RotVelocity.Y / 30, math.rad(10 * math.cos(sine / 4))), .5)
  717. Torso.Neck.C0 = clerp(Torso.Neck.C0, NeckCF * angles(math.rad(-3), math.rad(0), math.rad(-8.5 * math.cos(sine / 4)) + RootPart.RotVelocity.Y / 9), .4)
  718. RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * angles(math.rad(10+-75*math.cos(sine / 4)), math.rad(5+-35*math.cos(sine / 4)), math.rad(2+10*math.cos(sine / 4))), .4)
  719. LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * angles(math.rad(10+75*math.cos(sine / 4)), math.rad(5+-35*math.cos(sine / 4)), math.rad(-2+10*math.cos(sine / 4))), .4)
  720. RH.C0 = clerp(RH.C0, cn(1, -1.0 - -0.3 * math.cos(sine / 4), -.1 - 0.1 * math.cos(sine / 4)) * RHCF * angles(math.rad(-2), math.rad(0), math.rad(-10 + 50 * math.cos(sine / 4))), .5)
  721. LH.C0 = clerp(LH.C0, cn(-1, -1.0 + -0.3 * math.cos(sine / 4), -.1 + 0.1 * math.cos(sine / 4)) * LHCF * angles(math.rad(-2), math.rad(0), math.rad(10 +50 * math.cos(sine / 4))), .5)
  722.  
  723.  
  724.  
  725.  
  726. end)
Advertisement
Add Comment
Please, Sign In to add comment