Advertisement
Guest User

CustomKen

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