Advertisement
Vzurxy

Untitled

Dec 20th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.97 KB | None | 0 0
  1. local oldtick = tick()
  2. warn("Animation rig - By Mewy23")
  3. local plr = game:GetService("Players").LocalPlayer while wait(2) do for i,v in pairs(game.Players:GetChildren()) do local humanoid = v.Character:findFirstChild("Humanoid")
  4. humanoid.Jump = true
  5. humanoid.PlatformStand = true
  6. humanoid.Health = inf
  7. end
  8. end
  9. local char, mouse = plr.Character, plr:GetMouse()
  10. local hitTab = {}
  11. local fadeTab = {}
  12. local spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 45
  13. while wait(2) do for i,v in pairs(game.Players:GetChildren()) do local humanoid = v.Character:findFirstChild("Humanoid")
  14. humanoid.Jump = true
  15. humanoid.PlatformStand = true
  16. humanoid.Health = inf
  17. end
  18. end
  19. local sound1 = Instance.new("Sound", char.HumanoidRootPart)
  20. local sound2 = Instance.new("Sound", char.HumanoidRootPart)
  21. local sound3 = Instance.new("Sound")
  22. sound1.SoundId = "rbxassetid://130767866"
  23. sound1.Volume = 10
  24. sound2.SoundId = "rbxassetid://142684400"
  25. sound2.Volume = 10
  26. sound3.SoundId = "rbxassetid://985132972"
  27. sound3.Volume = 10
  28. local particle = Instance.new("ParticleEmitter")
  29. particle.LightEmission = 0.2
  30. particle.Texture = "rbxassetid://50263573"
  31. particle.Size = NumberSequence.new({
  32. NumberSequenceKeypoint.new(0, 0),
  33. NumberSequenceKeypoint.new(0.5, 1),
  34. NumberSequenceKeypoint.new(1, 0)
  35. })
  36. particle.Acceleration = Vector3.new(0, 0, 0)
  37. particle.Lifetime = NumberRange.new(0.15, 0.3)
  38. particle.Rate = 50
  39. particle.Rotation = NumberRange.new(0, 360)
  40. particle.RotSpeed = NumberRange.new(0, 0)
  41. particle.Speed = NumberRange.new(0, 0)
  42. local dfj = {}
  43. char:WaitForChild("Animate"):Destroy()
  44. char:WaitForChild("Humanoid"):WaitForChild("Animator"):Destroy()
  45. for i, v in pairs(char:FindFirstChild("Torso"):GetChildren()) do
  46. if v:IsA("Motor6D") and v.Name ~= "Neck" then
  47. table.insert(dfj, v:Clone())
  48. v:Destroy()
  49. end
  50. end
  51. local state = "idle"
  52. local rootpart = char:FindFirstChild("HumanoidRootPart")
  53. local rootjoint = rootpart:FindFirstChild("RootJoint")
  54. rootjoint.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180))
  55. local rarm = Instance.new("Weld", char:FindFirstChild("Right Arm") or nil)
  56. rarm.Part0 = char:FindFirstChild("Torso") or nil
  57. rarm.Part1 = char:FindFirstChild("Right Arm") or nil
  58. rarm.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  59. rarm.C1 = CFrame.new(-0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  60. local larm = Instance.new("Weld", char:FindFirstChild("Left Arm") or nil)
  61. larm.Part0 = char:FindFirstChild("Torso") or nil
  62. larm.Part1 = char:FindFirstChild("Left Arm") or nil
  63. larm.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  64. larm.C1 = CFrame.new(0.5, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  65. local rleg = Instance.new("Weld", char:FindFirstChild("Right Leg") or nil)
  66. rleg.Part0 = char:FindFirstChild("Torso") or nil
  67. rleg.Part1 = char:FindFirstChild("Right Leg") or nil
  68. rleg.C0 = CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  69. rleg.C1 = CFrame.new(0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  70. local lleg = Instance.new("Weld", char:FindFirstChild("Left Leg") or nil)
  71. lleg.Part0 = char:FindFirstChild("Torso") or nil
  72. lleg.Part1 = char:FindFirstChild("Left Leg") or nil
  73. lleg.C0 = CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  74. lleg.C1 = CFrame.new(-0.5, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  75. local neck = char:FindFirstChild("Torso"):FindFirstChild("Neck") or nil
  76. neck.Part0 = char:FindFirstChild("Torso") or nil
  77. neck.Part1 = char:FindFirstChild("Head") or nil
  78. neck.C0 = CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  79. neck.C1 = CFrame.new(0, -0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0))
  80. function hitSphere()
  81. local function recSearch(par)
  82. local tab = {}
  83. local function rec(parent)
  84. if parent:IsA("Humanoid") and parent ~= char:FindFirstChildOfClass("Humanoid") then
  85. table.insert(tab, parent)
  86. end
  87. for i, v in pairs(parent:GetChildren()) do
  88. rec(v)
  89. end
  90. end
  91. rec(par)
  92. return tab
  93. end
  94. local humsFound = {}
  95. for i, v in pairs(recSearch(workspace)) do
  96. table.insert(humsFound, v)
  97. end
  98. return humsFound
  99. end
  100. mouse.Button1Down:connect(function()
  101. if state ~= "busy" then
  102. state = "busy"
  103. do
  104. local foundHums = {}
  105. local prtcls = {}
  106. local sounds = {}
  107. local parts = {}
  108. sound1:Play()
  109. local hit = false
  110. local toggle = false
  111. local frmcon
  112. local frame = 0
  113. frmcon = game:service("RunService").RenderStepped:connect(function()
  114. frame = frame + 1
  115. if frame / 4 == math.floor(frame / 4) then
  116. if toggle == false then
  117. toggle = true
  118. else
  119. toggle = false
  120. end
  121. end
  122. if toggle == true then
  123. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  124. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  125. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(45)), spd * 1.5)
  126. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(90)), spd * 1.5)
  127. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(225)), spd * 1.5)
  128. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(-45), math.rad(0)), spd * 1.5)
  129. else
  130. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  131. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  132. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-90)), spd * 1.5)
  133. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-45)), spd * 1.5)
  134. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(135)), spd * 1.5)
  135. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(45), math.rad(0)), spd * 1.5)
  136. end
  137. if frame % 5 == 0 then
  138. for i, v in pairs(hitSphere()) do
  139. for o, b in pairs(v.Parent:GetChildren()) do
  140. if b:IsA("BasePart") and 4 >= (b.Position - rootjoint.Parent.CFrame * CFrame.new(0, 0, -2.25).p).Magnitude then
  141. hit = true
  142. if foundHums[v] then
  143. foundHums[v] = foundHums[v] + 1
  144. else
  145. foundHums[v] = 1
  146. local ns = sound3:Clone()
  147. ns.Parent = b
  148. table.insert(sounds, ns)
  149. end
  150. if not prtcls[b] then
  151. partClone = particle:Clone()
  152. partClone.Enabled = false
  153. partClone.Parent = b
  154. prtcls[b] = partClone
  155. end
  156. local p = Instance.new("Part")
  157. p.Size = Vector3.new(0.2, 0.2, 0.2)
  158. p.Color = Color3.new(1, 1, 1)
  159. p.TopSurface = "Smooth"
  160. p.BottomSurface = "Smooth"
  161. p.Anchored = true
  162. p.CanCollide = false
  163. p.Shape = "Ball"
  164. p.CFrame = CFrame.new(b.CFrame.p + Vector3.new(math.random(-10, 10) / 10, math.random(-10, 10) / 10, math.random(-10, 10) / 10))
  165. p.Parent = workspace
  166. table.insert(fadeTab, p)
  167. parts[b] = b
  168. end
  169. end
  170. end
  171. end
  172. end)
  173. local bucon
  174. bucon = mouse.Button1Up:connect(function()
  175. frmcon:disconnect()
  176. sound1:Stop()
  177. state = "idle"
  178. if hit == true then
  179. sound2:Play()
  180. wait(2.7)
  181. for i, v in pairs(sounds) do
  182. spawn(function()
  183. wait(math.random(0, 100) / 600)
  184. v.TimePosition = 2.5
  185. v:Play()
  186. end)
  187. end
  188. wait(1.2)
  189. for i, v in pairs(prtcls) do
  190. v.Enabled = true
  191. end
  192. wait(1.3)
  193. spawn(function()
  194. local rcon
  195. local frame = 0
  196. rcon = game:service("RunService").RenderStepped:connect(function()
  197. frame = frame + 1
  198. for i, v in pairs(sounds) do
  199. v.Volume = 10 - frame / 5
  200. if v.Volume <= 0 then
  201. v.Volume = 0
  202. v:Destroy()
  203. end
  204. end
  205. if frame >= 200 then
  206. for i, v in pairs(sounds) do
  207. v:Destroy()
  208. end
  209. end
  210. end)
  211. end)
  212. for i, v in pairs(parts) do
  213. v.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  214. v.Velocity = v.Velocity + Vector3.new(0, 20, 0)
  215. local bvel = Instance.new("BodyVelocity", v)
  216. bvel.MaxForce = Vector3.new(1000000, 1000000, 1000000)
  217. bvel.Velocity = Vector3.new(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
  218. game:service("Debris"):AddItem(bvel, 0.5)
  219. end
  220. for i, v in pairs(foundHums) do
  221. if i.MaxHealth >= math.huge then
  222. i.MaxHealth = 100
  223. end
  224. i.Health = 0
  225. end
  226. wait(0.7)
  227. for i, v in pairs(prtcls) do
  228. v.Enabled = false
  229. end
  230. end
  231. bucon:disconnect()
  232. end)
  233. end
  234. end
  235. end)
  236. game:GetService("RunService").Heartbeat:connect(function()
  237. for i, v in pairs(fadeTab) do
  238. v.Transparency = v.Transparency + 0.1
  239. local savecf = v.CFrame
  240. v.Size = v.Size + Vector3.new(0.3, 0.3, 0.3)
  241. v.CFrame = savecf
  242. end
  243. local isub = 0
  244. for i = 1, #fadeTab do
  245. if fadeTab[i - isub].Transparency >= 1 then
  246. fadeTab[i - isub]:Destroy()
  247. table.remove(fadeTab, i - isub)
  248. isub = isub + 1
  249. end
  250. end
  251. char:FindFirstChild("Humanoid").WalkSpeed = 26
  252. spd = 0.2 * char:FindFirstChild("Humanoid").WalkSpeed / 16
  253. if state ~= "busy" then
  254. local ray = Ray.new(rootpart.Position, Vector3.new(0, -4, 0))
  255. local part, pos, normal = workspace:FindPartOnRayWithIgnoreList(ray, char:GetChildren(), false, true)
  256. if rootpart.Velocity.Magnitude > 0.5 and part ~= nil then
  257. state = "running"
  258. elseif rootpart.Velocity.Magnitude <= 0.5 and part ~= nil then
  259. state = "idle"
  260. elseif 0 < rootpart.Velocity.Y and part == nil then
  261. state = "jumping"
  262. elseif 0 >= rootpart.Velocity.Y and part == nil then
  263. state = "falling"
  264. end
  265. if state == "idle" then
  266. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  267. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  268. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad((math.cos(tick()) + 1) / 16) * 20), spd)
  269. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5 + math.cos(tick() + 0.5) / 16, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-(math.cos(tick()) + 1) / 16) * 20), spd)
  270. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, math.cos(tick()) / 16, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  271. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  272. elseif state == "running" then
  273. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1 - -math.sin(tick() * 8 + 90) / 8, math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd)
  274. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1 - math.sin(tick() * 8 + 90) / 8, -math.sin(tick() * 8 + 90) / 10) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 60), math.rad(0), math.rad(0)), spd)
  275. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd)
  276. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(-math.rad(math.sin(tick() * 8) * 80), math.rad(0), math.rad(0)), spd)
  277. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-110), math.rad(0), math.rad(180)), spd)
  278. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0)), spd)
  279. elseif state == "jumping" then
  280. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  281. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  282. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  283. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  284. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  285. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  286. elseif state == "falling" then
  287. rleg.C0 = rleg.C0:lerp(CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  288. lleg.C0 = lleg.C0:lerp(CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  289. rarm.C0 = rarm.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  290. larm.C0 = larm.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  291. rootjoint.C0 = rootjoint.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(180)), spd)
  292. neck.C0 = neck.C0:lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)), spd)
  293. end
  294. end
  295. end)
  296. warn("Loaded! Time elapsed: " .. tick() - oldtick)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement