Advertisement
AjareliVajkaci

FE OLD R6 CLASSIC ANIMATION PACK

Nov 12th, 2024
590
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 1 0
  1. --FE OLD R6 ANIMATION PACK CLASSIC. (works in some games)
  2.  
  3. game.Players.LocalPlayer.Character:BreakJoints()
  4. game.Players.LocalPlayer.Character=nil
  5. Connection = game.Workspace.DescendantAdded:Connect(function(c)
  6. if c.Name == "Animate" then
  7. c.Disabled=true
  8. end
  9. end)
  10. repeat wait() until game.Players.LocalPlayer.Character
  11. Char = game.Players.LocalPlayer.Character
  12. Died = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
  13. Connection:Disconnect()
  14. Died:Disconnect()
  15. end)
  16. wait(.1)
  17. function waitForChild(parent, childName)
  18. local child = parent:findFirstChild(childName)
  19. if child then return child end
  20. while true do
  21. child = parent.ChildAdded:wait()
  22. if child.Name==childName then return child end
  23. end
  24. end
  25.  
  26. -- ANIMATION
  27.  
  28. -- declarations
  29.  
  30. local Figure = game.Players.LocalPlayer.Character
  31. local Torso = waitForChild(Figure, "Torso")
  32. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  33. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  34. local RightHip = waitForChild(Torso, "Right Hip")
  35. local LeftHip = waitForChild(Torso, "Left Hip")
  36. local Neck = waitForChild(Torso, "Neck")
  37. local Humanoid = waitForChild(Figure, "Humanoid")
  38. local pose = "Standing"
  39.  
  40. local toolAnim = "None"
  41. local toolAnimTime = 0
  42.  
  43. local jumpMaxLimbVelocity = 0.75
  44.  
  45. -- functions
  46.  
  47. function onRunning(speed)
  48. if speed>0 then
  49. pose = "Running"
  50. else
  51. pose = "Standing"
  52. end
  53. end
  54.  
  55. function onDied()
  56. pose = "Dead"
  57. end
  58.  
  59. function onJumping()
  60. pose = "Jumping"
  61. end
  62.  
  63. function onClimbing()
  64. pose = "Climbing"
  65. end
  66.  
  67. function onGettingUp()
  68. pose = "GettingUp"
  69. end
  70.  
  71. function onFreeFall()
  72. pose = "FreeFall"
  73. end
  74.  
  75. function onFallingDown()
  76. pose = "FallingDown"
  77. end
  78.  
  79. function onSeated()
  80. pose = "Seated"
  81. end
  82.  
  83. function onPlatformStanding()
  84. pose = "PlatformStanding"
  85. end
  86.  
  87. function onSwimming(speed)
  88. if speed>0 then
  89. pose = "Running"
  90. else
  91. pose = "Standing"
  92. end
  93. end
  94.  
  95. function moveJump()
  96. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  97. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  98. RightShoulder:SetDesiredAngle(3.14)
  99. LeftShoulder:SetDesiredAngle(-3.14)
  100. RightHip:SetDesiredAngle(0)
  101. LeftHip:SetDesiredAngle(0)
  102. end
  103.  
  104.  
  105. -- same as jump for now
  106.  
  107. function moveFreeFall()
  108. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  109. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  110. RightShoulder:SetDesiredAngle(3.14)
  111. LeftShoulder:SetDesiredAngle(-3.14)
  112. RightHip:SetDesiredAngle(0)
  113. LeftHip:SetDesiredAngle(0)
  114. end
  115.  
  116. function moveSit()
  117. RightShoulder.MaxVelocity = 0.15
  118. LeftShoulder.MaxVelocity = 0.15
  119. RightShoulder:SetDesiredAngle(3.14 /2)
  120. LeftShoulder:SetDesiredAngle(-3.14 /2)
  121. RightHip:SetDesiredAngle(3.14 /2)
  122. LeftHip:SetDesiredAngle(-3.14 /2)
  123. end
  124.  
  125. function getTool()
  126. for _, kid in ipairs(Figure:GetChildren()) do
  127. if kid.className == "Tool" then return kid end
  128. end
  129. return nil
  130. end
  131.  
  132. function getToolAnim(tool)
  133. for _, c in ipairs(tool:GetChildren()) do
  134. if c.Name == "toolanim" and c.className == "StringValue" then
  135. return c
  136. end
  137. end
  138. return nil
  139. end
  140.  
  141. function animateTool()
  142.  
  143. if (toolAnim == "None") then
  144. RightShoulder:SetDesiredAngle(1.57)
  145. return
  146. end
  147.  
  148. if (toolAnim == "Slash") then
  149. RightShoulder.MaxVelocity = 0.5
  150. RightShoulder:SetDesiredAngle(0)
  151. return
  152. end
  153.  
  154. if (toolAnim == "Lunge") then
  155. RightShoulder.MaxVelocity = 0.5
  156. LeftShoulder.MaxVelocity = 0.5
  157. RightHip.MaxVelocity = 0.5
  158. LeftHip.MaxVelocity = 0.5
  159. RightShoulder:SetDesiredAngle(1.57)
  160. LeftShoulder:SetDesiredAngle(1.0)
  161. RightHip:SetDesiredAngle(1.57)
  162. LeftHip:SetDesiredAngle(1.0)
  163. return
  164. end
  165. end
  166.  
  167. function move(time)
  168. local amplitude
  169. local frequency
  170.  
  171. if (pose == "Jumping") then
  172. moveJump()
  173. return
  174. end
  175.  
  176. if (pose == "FreeFall") then
  177. moveFreeFall()
  178. return
  179. end
  180.  
  181. if (pose == "Seated") then
  182. moveSit()
  183. return
  184. end
  185.  
  186. local climbFudge = 0
  187.  
  188. if (pose == "Running") then
  189. if (RightShoulder.CurrentAngle > 1.5 or RightShoulder.CurrentAngle < -1.5) then
  190. RightShoulder.MaxVelocity = jumpMaxLimbVelocity
  191. else
  192. RightShoulder.MaxVelocity = 0.15
  193. end
  194. if (LeftShoulder.CurrentAngle > 1.5 or LeftShoulder.CurrentAngle < -1.5) then
  195. LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
  196. else
  197. LeftShoulder.MaxVelocity = 0.15
  198. end
  199. amplitude = 1
  200. frequency = 9
  201. elseif (pose == "Climbing") then
  202. RightShoulder.MaxVelocity = 0.5
  203. LeftShoulder.MaxVelocity = 0.5
  204. amplitude = 1
  205. frequency = 9
  206. climbFudge = 3.14
  207. else
  208. amplitude = 0.1
  209. frequency = 1
  210. end
  211.  
  212. desiredAngle = amplitude * math.sin(time*frequency)
  213.  
  214. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  215. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  216. RightHip:SetDesiredAngle(-desiredAngle)
  217. LeftHip:SetDesiredAngle(-desiredAngle)
  218.  
  219.  
  220. local tool = getTool()
  221.  
  222. if tool then
  223.  
  224. animStringValueObject = getToolAnim(tool)
  225.  
  226. if animStringValueObject then
  227. toolAnim = animStringValueObject.Value
  228. -- message recieved, delete StringValue
  229. animStringValueObject.Parent = nil
  230. toolAnimTime = time + .3
  231. end
  232.  
  233. if time > toolAnimTime then
  234. toolAnimTime = 0
  235. toolAnim = "None"
  236. end
  237.  
  238. animateTool()
  239.  
  240.  
  241. else
  242. toolAnim = "None"
  243. toolAnimTime = 0
  244. end
  245. end
  246.  
  247.  
  248. -- connect events
  249.  
  250. Humanoid.Died:connect(onDied)
  251. Humanoid.Running:connect(onRunning)
  252. Humanoid.Jumping:connect(onJumping)
  253. Humanoid.Climbing:connect(onClimbing)
  254. Humanoid.GettingUp:connect(onGettingUp)
  255. Humanoid.FreeFalling:connect(onFreeFall)
  256. Humanoid.FallingDown:connect(onFallingDown)
  257. Humanoid.Seated:connect(onSeated)
  258. Humanoid.PlatformStanding:connect(onPlatformStanding)
  259. Humanoid.Swimming:connect(onSwimming)
  260. -- main program
  261.  
  262. local runService = game:service("RunService");
  263.  
  264. while Figure.Parent~=nil do
  265. local _, time = wait(0.1)
  266. move(time)
  267. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement