Advertisement
GalaxyDelta

Untitled

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