Advertisement
9Simplicity9

PlayAnimationFromTable Scripting Kit By UndeniableInfinity

Jul 18th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. Player = game:GetService("Players").LocalPlayer
  2. PlayerGui = Player.PlayerGui
  3. Cam = workspace.CurrentCamera
  4. Backpack = Player.Backpack
  5. Character = Player.Character
  6. Humanoid = Character.Humanoid
  7. Mouse = Player:GetMouse()
  8. RootPart = Character["HumanoidRootPart"]
  9. Torso = Character["Torso"]
  10. Head = Character["Head"]
  11. RightArm = Character["Right Arm"]
  12. LeftArm = Character["Left Arm"]
  13. RightLeg = Character["Right Leg"]
  14. LeftLeg = Character["Left Leg"]
  15. RootJoint = RootPart["RootJoint"]
  16. Neck = Torso["Neck"]
  17. RightShoulder = Torso["Right Shoulder"]
  18. LeftShoulder = Torso["Left Shoulder"]
  19. RightHip = Torso["Right Hip"]
  20. LeftHip = Torso["Left Hip"]
  21.  
  22. IT = Instance.new
  23. CF = CFrame.new
  24. VT = Vector3.new
  25. RAD = math.rad
  26. C3 = Color3.new
  27. UD2 = UDim2.new
  28. BRICKC = BrickColor.new
  29. ANGLES = CFrame.Angles
  30. EULER = CFrame.fromEulerAnglesXYZ
  31. COS = math.cos
  32. ACOS = math.acos
  33. SIN = math.sin
  34. ASIN = math.asin
  35. ABS = math.abs
  36. MRANDOM = math.random
  37. FLOOR = math.floor
  38.  
  39. Character.Animate.Parent = nil
  40. for i,v in pairs(Humanoid:GetPlayingAnimationTracks()) do
  41. v:Stop()
  42. end
  43.  
  44. ArtificialHB = Instance.new("BindableEvent", script)
  45. ArtificialHB.Name = "ArtificialHB"
  46.  
  47. script:WaitForChild("ArtificialHB")
  48.  
  49. frame = 1/60
  50. tf = 0
  51. allowframeloss = false
  52. tossremainder = false
  53. lastframe = tick()
  54. script.ArtificialHB:Fire()
  55.  
  56. game:GetService("RunService").Heartbeat:connect(function(s, p)
  57. tf = tf + s
  58. if tf >= frame then
  59. if allowframeloss then
  60. script.ArtificialHB:Fire()
  61. lastframe = tick()
  62. else
  63. for i = 1, math.floor(tf / frame) do
  64. script.ArtificialHB:Fire()
  65. end
  66. lastframe = tick()
  67. end
  68. if tossremainder then
  69. tf = 0
  70. else
  71. tf = tf - frame * math.floor(tf / frame)
  72. end
  73. end
  74. end)
  75.  
  76. function Swait(NUMBER)
  77. if NUMBER == 0 or NUMBER == nil then
  78. ArtificialHB.Event:wait()
  79. else
  80. for i = 1, NUMBER do
  81. ArtificialHB.Event:wait()
  82. end
  83. end
  84. end
  85.  
  86. function Clerp(a,b,t)
  87. return a:lerp(b,t)
  88. end
  89.  
  90. function PlayAnim(tablee, speed)
  91. RootJoint.Transform = Clerp(RootJoint.Transform, tablee[1], speed)
  92. Neck.Transform = Clerp(Neck.Transform, tablee[2], speed)
  93. RightShoulder.Transform = Clerp(RightShoulder.Transform, tablee[3], speed)
  94. LeftShoulder.Transform = Clerp(LeftShoulder.Transform, tablee[4], speed)
  95. RightHip.Transform = Clerp(RightHip.Transform, tablee[5], speed)
  96. LeftHip.Transform = Clerp(LeftHip.Transform, tablee[6], speed)
  97. end
  98.  
  99. while true do
  100.  
  101. wait(3)
  102.  
  103. PlayAnim({
  104. CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  105. CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  106. CFrame.new0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  107. CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  108. CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  109. CFrame.new(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
  110. }, 1, 1)
  111.  
  112. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement