Advertisement
Guest User

Sago

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