Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.50 KB | None | 0 0
  1. --One Punch Man Script
  2. p = game.Players.LocalPlayer
  3. char = p.Character
  4. des = false
  5. fling = true
  6. dot = false
  7. falling = false
  8. jump = true
  9. --char.Shirt:Remove()
  10. --for i,v in pairs(char:GetChildren()) do if v:IsA("Pants") then v:Remove() end end
  11. for i,v in pairs(char:GetChildren()) do if v:IsA("Hat") then v.Handle:Remove() end end
  12. wait()--shirt = Instance.new("Shirt", char)
  13. --shirt.Name = "Shirt"
  14. --pants = Instance.new("Pants", char)
  15. --pants.Name = "Pants"
  16.  
  17. --char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=451927425"
  18. --char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=236412261"
  19. tp = true
  20. shoot = true
  21. hum = char.Humanoid
  22. punch = true
  23. neckp = char.Torso.Neck.C0
  24. neck = char.Torso.Neck
  25. hum.MaxHealth = 9999999999999999999999999999999999999999
  26. wait()
  27. hum.Health =hum.MaxHealth
  28. des = false
  29. root=char.HumanoidRootPart
  30. torso = char.Torso
  31. char.Head.face.Texture = "rbxassetid://332768867"
  32. local ChatService = game:GetService("Chat")
  33. local player = game.Players.LocalPlayer
  34. lig = Instance.new("PointLight",player.Character.Torso)
  35. lig.Color=Color3.new(255,0,0)
  36. m=player:GetMouse()
  37. bb = Instance.new("BillboardGui",player.Character.Head)
  38. bb.Enabled = true
  39. function newRay(start,face,range,wat)
  40. local rey=Ray.new(start.p,(face.p-start.p).Unit*range)
  41. hit,pos=Workspace:FindPartOnRayWithIgnoreList(rey,wat)
  42. return rey,hit,pos
  43. end
  44. aa1={}
  45. torso=game.Players.LocalPlayer.Character.Torso
  46.  
  47. local WorldUp = Vector3.new(0,1,0)
  48. function look2(Vec1,Vec2)
  49. local Orig = Vec1
  50. Vec1 = Vec1+Vector3.new(0,1,0)
  51. Vec2 = Vec2+Vector3.new(0,1,0)
  52. local Forward = (Vec2-Vec1).unit
  53. local Up = (WorldUp-WorldUp:Dot(Forward)*Forward).unit
  54. local Right = Up:Cross(Forward).unit
  55. Forward = -Forward
  56. Right = -Right
  57. return CFrame.new(Orig.X,Orig.Y,Orig.Z,Right.X,Up.X,Forward.X,Right.Y,Up.Y,Forward.Y,Right.Z,Up.Z,Forward.Z)
  58. end
  59.  
  60. function look(CFr,Vec2)
  61. local A = Vector3.new(0,0,0)
  62. local B = CFr:inverse()*Vec2
  63. local CF = look2(A,Vector3.new(A.X,B.Y,B.Z))
  64. if B.Z > 0 then
  65. CF = CFr*(CF*CFrame.Angles(0,0,math.pi))
  66. elseif B.Z == 0 then
  67. if B.Y > 0 then
  68. CF = CFr*CFrame.Angles(math.pi/2,0,0)
  69. elseif B.Y < 0 then
  70. CF = CFr*CFrame.Angles(-math.pi/2,0,0)
  71. else
  72. CF = CFr
  73. end
  74. end
  75. local _,_,_,_,X,_,_,Y,_,_,Z,_ = CF:components()
  76. local Up = Vector3.new(X,Y,Z)
  77. local Forward = (Vec2-CFr.p).unit
  78. local Right = Up:Cross(Forward)
  79. Forward = -Forward
  80. Right = -Right
  81. return CFrame.new(CFr.X,CFr.Y,CFr.Z,Right.X,Up.X,Forward.X,Right.Y,Up.Y,Forward.Y,Right.Z,Up.Z,Forward.Z)
  82. end
  83.  
  84. function simulate(j,d,m,r,t)
  85. local joint = j
  86. for i,v in ipairs(t) do
  87. if v[1]:FindFirstChild("Weld") then
  88. local stiff = m.CFrame.lookVector*0.03
  89. if i > 1 then joint = t[i-1][1].CFrame*CFrame.new(0,0,d*.5) end
  90. local dir = (v[2].p-(joint.p+Vector3.new(0,0.2,0)+stiff)).unit
  91. local dis = (v[2].p-(joint.p+Vector3.new(0,0.2,0)+stiff)).magnitude
  92. local pos = joint.p+(dir*(d*0.5))
  93. --if v[1].CFrame.y<=workspace.Base.CFrame.y then pos = joint.p+(dir*(d*.5)) end
  94. local inv = v[1].Weld.Part0.CFrame
  95. local rel1 = inv:inverse()*pos
  96. local rel2 = inv:inverse()*(pos-(dir*dis))
  97. local cf = look(CFrame.new(rel1),rel2)--CFrame.new(pos,pos-(dir*dis))*CFrame.fromEulerAnglesXYZ(r.x,r.y,r.z)
  98. v[1].Weld.C0 = cf
  99. v[2] = inv*cf
  100. --v[1].CFrame = cf
  101. end
  102. end
  103. end
  104. for i=1,8 do
  105. local p = Instance.new("Part",char)
  106. p.Anchored = false
  107. p.BrickColor = BrickColor.new("Institutional white")
  108. p.CanCollide = false
  109. p.FormFactor="Custom"
  110. p.Material = "SmoothPlastic"
  111. p.TopSurface = "SmoothNoOutlines"
  112. p.BottomSurface = "SmoothNoOutlines"
  113. p.RightSurface = "SmoothNoOutlines"
  114. p.LeftSurface = "SmoothNoOutlines"
  115. p.FrontSurface = "SmoothNoOutlines"
  116. p.BackSurface = "SmoothNoOutlines"
  117.  
  118. p.Size=Vector3.new(2,.2,0.2)
  119. p:BreakJoints() -- sometimes the parts are stuck to something so you have to breakjoints them
  120. mesh = Instance.new("BlockMesh",p)
  121. mesh.Scale = Vector3.new(1,1,4)
  122. local w = Instance.new("Motor6D",p)
  123. w.Part0 = aa1[i-1] and aa1[i-1][1] or torso
  124. w.Part1 = p
  125. w.Name = "Weld"
  126. --table.insert(aa1,p)
  127. aa1[i] = {p,p.CFrame}
  128.  
  129. end
  130. game:service"RunService".Stepped:connect(function()
  131. simulate(torso.CFrame*CFrame.new(0,0.9,.5),.6,torso,Vector3.new(),aa1)
  132. end)
  133. bb.AlwaysOnTop = true
  134. bb.Size = UDim2.new(0,200,0,50)
  135. bb.StudsOffset = Vector3.new(0,1,0)
  136. gui=Instance.new("TextBox",bb)
  137. gui.Text = "* "
  138. gui.Size = UDim2.new(0,133,0,45)
  139. gui.Position=UDim2.new(0,57,0,-40)
  140. gui.TextColor3 = Color3.new(255,255,255)
  141. gui.BackgroundColor3=Color3.new(0,0,0)
  142. gui.TextWrapped = true
  143. gui.TextScaled = true
  144. gui.TextXAlignment = "Left"
  145. gui.TextYAlignment = "Top"
  146. gui.Visible = false
  147. gui.BorderColor3 = Color3.new(0,0,0)
  148. punch2 = true
  149. gui1=Instance.new("TextButton",bb)
  150. gui1.Position=UDim2.new(0,5,0,-43)
  151. gui1.Size = UDim2.new(0,190,0,51)
  152.  
  153. gui1.TextColor3 = Color3.new(255,255,255)
  154. gui1.BackgroundColor3=Color3.new(255,255,255)
  155. jump2 = true
  156. gui1.Visible = false
  157. img = Instance.new("ImageLabel",bb)
  158. img.Size = UDim2.new(0,46,0,47)
  159. img.Position = UDim2.new(0,10,0,-41)
  160. img.Image = "rbxassetid://447301252"
  161. img.BorderColor3 = Color3.new(0,0,0)
  162. img.Visible = false
  163. soka = Instance.new("Sound",char)
  164. soka.SoundId = "http://www.roblox.com/asset/?id = 447199232"
  165. soka.Volume = 1
  166. boom = Instance.new("Sound",char)
  167. boom.SoundId = "http://www.roblox.com/asset/?id = 447041606"
  168. boom.Volume = 1
  169. boom2 = Instance.new("Sound",char)
  170. boom2.SoundId = "http://www.roblox.com/asset/?id = 449025737"
  171. boom2.Volume = 1
  172. boom3 = Instance.new("Sound",char)
  173. boom3.SoundId = "http://www.roblox.com/asset/?id = 450719019"
  174. boom3.Volume = 1
  175. tps = Instance.new("Sound",char)
  176. tps.SoundId = "http://www.roblox.com/asset/?id = 449860746"
  177. tps.Volume = 1
  178. asd = Instance.new("Sound",char)
  179. asd.SoundId = "http://www.roblox.com/asset/?id = 447310433"
  180. asd.Volume =1
  181. asd1 = Instance.new("Sound",char)
  182. asd1.SoundId = "http://www.roblox.com/asset/?id = 358280695"
  183.  
  184. asd2 = Instance.new("Sound",char)
  185. asd2.SoundId = "http://www.roblox.com/asset/?id = 386713054"
  186. asd2.Looped = true
  187. asd2.Volume = 5
  188. asd3 = Instance.new("Sound",char)
  189. asd3.SoundId = "http://www.roblox.com/asset/?id = 378387996"
  190. asd3.Looped = true
  191. asd4 = Instance.new("Sound",char)
  192. asd4.SoundId = "http://www.roblox.com/asset/?id = 401258325"
  193. asd4.Looped = true
  194. asd5 = Instance.new("Sound",char)
  195. asd5.SoundId = "http://www.roblox.com/asset/?id = 362252261"
  196. asd5.Looped = true
  197. gas = Instance.new("Sound",char)
  198. gas.SoundId = "http://www.roblox.com/asset/?id = 345052019"
  199. asd6 = Instance.new("Sound",char)
  200. asd6.SoundId = "http://www.roblox.com/asset/?id = 401258325"
  201. asd6.Looped = true
  202. function play(play)
  203. asd:Play()
  204. wait(0.05)
  205. --asd1:Play()
  206. end
  207.  
  208.  
  209.  
  210. ------------
  211. -------------------------
  212.  
  213. function stream(origin,dir,length,size)
  214. local parts = {}
  215. for i = 1,length do
  216. local p = Instance.new("Part",char)
  217. p.Anchored = true
  218. p.Transparency = 0.5
  219. p.TopSurface = 0
  220. p.BottomSurface = 0
  221. p.CanCollide = false
  222. p.BrickColor = BrickColor.new("Institutional white")
  223. p.Size = Vector3.new(10,30,10) -- for now
  224. p.CFrame = CFrame.new(origin+dir*i*size)*CFrame.Angles(math.random()*math.pi,math.random()*math.pi,math.random()*math.pi)
  225. parts[i] = {p,CFrame.Angles(math.random()*math.pi/5,math.random()*math.pi/5,math.random()*math.pi/5)}
  226. game:GetService("Debris"):AddItem(p,3)
  227. end
  228. Spawn(function()
  229. while parts do
  230. for i,v in pairs(parts) do
  231. if v[1].Parent == char then
  232. v[1].CFrame = v[1].CFrame*v[2]
  233. else
  234. parts = nil
  235. break
  236. end
  237. end
  238. wait(0.02)
  239. end
  240. end)
  241. end
  242.  
  243. --[[-- listen for their chatting
  244. player.Chatted:connect(function(message)
  245. a = string.len(message)
  246. gui.Text = ""
  247. gui.Visible = true
  248. gui1.Visible = true
  249. des = false
  250. img.Visible = true
  251. print(a)
  252. if dot == false then
  253. gui.Text = ""
  254. for i = 1,string.len(message) do
  255. gui.Text =gui.Text..message:sub(i,i)
  256. play()
  257.  
  258. end
  259. end
  260.  
  261.  
  262. des = true
  263. end)]]--
  264. m.KeyDown:connect(function(k)
  265. if k == "g" then
  266. asd2:Play()
  267.  
  268.  
  269. end
  270. end)
  271.  
  272. m.KeyDown:connect(function(k)
  273. if k == "r" then
  274.  
  275. asd4:Play()
  276. end
  277. end)
  278. m.KeyDown:connect(function(k)
  279. if k == "q" then
  280.  
  281. asd3:Play()
  282. end
  283. end)
  284. m.KeyDown:connect(function(k)
  285. if k == "z" then
  286. img.Image = "rbxassetid://332766052"
  287.  
  288. end
  289. end)
  290. m.KeyDown:connect(function(k)
  291. if k == "c" then
  292. img.Image = "rbxassetid://447301252"
  293.  
  294. end
  295. end)
  296. m.KeyDown:connect(function(k)
  297. if k == "b" then
  298.  
  299. asd6:Play()
  300. end
  301. end)
  302. mouse = p:GetMouse()
  303. m.KeyDown:connect(function(k)
  304. if k:byte() == 48 then
  305.  
  306. hum.WalkSpeed = 100
  307. end
  308. end)
  309. m.KeyDown:connect(function(k)
  310. if k:byte() == 50 then
  311.  
  312. soka:Play()
  313. end
  314. end)
  315. m.KeyDown:connect(function(k)
  316. if k:byte() == 52 then
  317.  
  318. char.Head.face.Texture = "rbxassetid://444037452"
  319. end
  320. end)
  321. m.KeyDown:connect(function(k)
  322. if k:byte() == 51 then
  323.  
  324. char.Head.face.Texture = "rbxassetid://332768867"
  325. end
  326. end)
  327. m.KeyUp:connect(function(k)
  328. if k:byte() == 48 then
  329.  
  330. hum.WalkSpeed = 16
  331. end
  332. end)
  333. p.Chatted:connect(function(m)
  334. if m == "Okay." then
  335. soka:Play()
  336. end
  337. end)
  338. m.KeyDown:connect(function(k)
  339. if k == "x" then
  340. if des == true then
  341. gui.Visible = false
  342. gui.Text = "* "
  343. gui1.Visible = false
  344. img.Visible = false
  345. end
  346. end
  347. end)
  348. m.KeyDown:connect(function(key)
  349. if key == "j" then
  350. if tp == true then
  351. tp = false
  352. tps:Play()
  353. char.Head.face.Parent = game.Lighting
  354. for i,v in pairs(char:GetChildren()) do if v:IsA("Part") then v.Transparency = 1
  355. end
  356.  
  357. end
  358. wait(0.5)
  359. for i,v in pairs(char:GetChildren()) do if v:IsA("Part") then v.Transparency = 0
  360. end
  361.  
  362. end
  363. char.HumanoidRootPart.CFrame = mouse.Hit * CFrame.new(0, 3, 0)
  364. char.HumanoidRootPart.Transparency = 1
  365. game.Lighting.face.Parent = char.Head
  366. wait(0.2)
  367.  
  368. tp = true
  369.  
  370.  
  371. end
  372. end
  373. end)
  374.  
  375.  
  376. m.KeyDown:connect(function(key)
  377. if key == "t" then
  378. if punch2 == true then
  379. punch2 = false
  380. punch = false
  381.  
  382. local ChatService = game:GetService("Chat")
  383.  
  384. neck.C0 = neck.C0 * CFrame.Angles(0.3,0,0)
  385. ChatService:Chat(char.Head, "Mind if I get Serious?")
  386. wait(1)
  387. local ChatService = game:GetService("Chat")
  388.  
  389.  
  390. ChatService:Chat(char.Head ,"Killer Move: Serious Series...")
  391. wait(1)
  392. local ChatService = game:GetService("Chat")
  393.  
  394.  
  395. ChatService:Chat(char.Head, "SERIOUS PUNCH.")
  396. neck.C0 = neckp
  397. wait(0.6)
  398. org = char.Torso["Left Shoulder"].C0
  399. char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.new(-0.3,0,0) * CFrame.Angles(0,0,math.rad(-90))
  400. wait()
  401. killbrick2 = Instance.new("Part",char)
  402. killbrick2.Size = Vector3.new(80,80,9000)
  403. killbrick2.Transparency = 1
  404.  
  405. killbrick2.CanCollide = true
  406. wait(0.1)
  407. killbrick2.CanCollide = false
  408.  
  409. killbrick2.Anchored = true
  410.  
  411. killbrick2.CFrame = char.Torso.CFrame * CFrame.new(0,0,-1005)
  412.  
  413. killbrick2.Touched:connect(function(h)
  414. local x = h.Parent:FindFirstChild("Humanoid")
  415. if x then
  416. if x.Parent.Name == game.Players.LocalPlayer.Name then
  417. safe = true
  418. else safe = false
  419. end
  420. if x then
  421. if safe == false then
  422. h.Parent.Torso.Velocity = CFrame.new(char.Torso.Position,h.Parent.Torso.Position).lookVector * 900
  423. local bodyforc = Instance.new("BodyForce", h.Parent.Torso)
  424. boom:Play()
  425. bodyforc.force = Vector3.new(0, h.Parent.Torso:GetMass() * 196.1, 0)
  426.  
  427.  
  428. wait(0.2)
  429. x.Parent:BreakJoints()
  430. wait()
  431. safe = true
  432. end
  433. end
  434. end
  435. end)
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444. local rng = Instance.new("Part", char)
  445. rng.Anchored = true
  446. rng.BrickColor = BrickColor.new("Institutional white")
  447. rng.CanCollide = false
  448. rng.FormFactor = 3
  449. rng.Name = "Ring"
  450. rng.Size = Vector3.new(1, 1, 1)
  451. rng.Transparency = 0.8
  452. rng.TopSurface = 0
  453. rng.BottomSurface = 0
  454. rng.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
  455. --rng.Rotation = Vector3.new(math.pi/2,0,0)
  456. rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  457. local rngm = Instance.new("SpecialMesh", rng)
  458. rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
  459. rngm.Scale = Vector3.new(1, 1.3, 2)
  460. local rng1 = Instance.new("Part", char)
  461. rng1.Anchored = true
  462. rng1.BrickColor = BrickColor.new("Institutional white")
  463. rng1.CanCollide = false
  464. rng1.FormFactor = 3
  465. rng1.Name = "Ring"
  466. rng1.Size = Vector3.new(1, 1, 1)
  467. rng1.Transparency = 0.8
  468. rng1.TopSurface = 0
  469. rng1.BottomSurface = 0
  470. rng1.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
  471. --rng1.Rotation = Vector3.new(math.pi/2,0,0)
  472. rng1.CFrame = rng1.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  473. local rngm1 = Instance.new("SpecialMesh", rng1)
  474. rngm1.MeshId = "http://www.roblox.com/asset/?id=3270017"
  475. rngm1.Scale = Vector3.new(1, 1.3, 2)
  476.  
  477. local p = (torso.CFrame*CFrame.new(-20,0,3))
  478. stream(p.p,((p*Vector3.new(-0.7,0,1))-p.p).unit,90,5) -- 20 is number of parts, 6 is distance between each one
  479. local p = (torso.CFrame*CFrame.new(20,0,3))
  480. stream(p.p,((p*Vector3.new(0.7,0,1))-p.p).unit,90,5) -- same here
  481.  
  482. local rng2 = Instance.new("Part", char)
  483. rng2.Anchored = true
  484. rng2.BrickColor = BrickColor.new("Institutional white")
  485. rng2.CanCollide = false
  486. rng2.FormFactor = 3
  487. rng2.Name = "Ring"
  488. rng2.Size = Vector3.new(1, 1, 1)
  489. rng2.Transparency = 0.8
  490. rng2.TopSurface = 0
  491. rng2.BottomSurface = 0
  492. rng2.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
  493. --rng1.Rotation = Vector3.new(math.pi/2,0,0)
  494. rng2.CFrame = rng2.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  495. local rngm2 = Instance.new("SpecialMesh", rng2)
  496. rngm2.MeshId = "http://www.roblox.com/asset/?id=3270017"
  497. rngm2.Scale = Vector3.new(1, 1.3, 2)
  498. wait(0.1)
  499.  
  500. boom3:Play()
  501. coroutine.wrap(function()
  502. for i = 1, 35, 0.5 do
  503.  
  504.  
  505.  
  506.  
  507.  
  508. rngm.Scale = Vector3.new(50 + i*2, 10 + i*2, 2.5+ i*4)
  509. rngm1.Scale = Vector3.new(50 + i*2, 1.4 + i*2, 1.4+ i*4)
  510. rngm2.Scale = Vector3.new(50 + i*2, 10 + i*2, 1.2+ i*4)
  511.  
  512. wait()
  513. end
  514. wait()
  515. rng:Destroy()
  516. rng1:Destroy()
  517. rng2:Destroy()
  518. killbrick2:Remove()
  519. wait(0.5)
  520. char.Torso["Left Shoulder"].C0 = org
  521. wait(1)
  522. punch2 = true
  523. punch = true
  524. wait()
  525.  
  526.  
  527. end)()
  528.  
  529.  
  530.  
  531. end
  532.  
  533.  
  534. wait(.1)
  535.  
  536.  
  537. end
  538. end)
  539.  
  540.  
  541.  
  542.  
  543.  
  544. m.KeyDown:connect(function(key)
  545. if key == "k" then
  546. if punch == true then
  547. punch = false
  548. org = char.Torso["Left Shoulder"].C0
  549. char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0 * CFrame.new(-0.3,0,0) * CFrame.Angles(0,0,math.rad(-90))
  550. killbrick = Instance.new("Part",char)
  551. killbrick.Size = Vector3.new(5,1,5)
  552. killbrick.Transparency = 1
  553. killbrick:BreakJoints()
  554. killbrick.CanCollide = false
  555. local wel = Instance.new("Weld",killbrick)
  556. wel.Part0 = killbrick
  557. wel.Part1 = char["Left Arm"]
  558. wel.C0 = CFrame.new(0,1,0)
  559. force = 90
  560.  
  561. killbrick.Touched:connect(function(h)
  562. local x = h.Parent.Humanoid
  563. if x.Health >= 6000 then
  564. fling = false
  565. end
  566. if x.Health < 6000 then
  567. fling = true
  568. end
  569. local stop = h.Parent.Torso.Velocity
  570. if x.Parent.Name == game.Players.LocalPlayer.Name then
  571. safe = true
  572. else safe = false
  573. end
  574. if x then
  575. if safe == false then
  576. if fling == true then
  577. force = 900
  578.  
  579. end
  580. if fling == false then
  581. force = 200
  582. end
  583.  
  584.  
  585. h.Parent.Torso.Velocity = CFrame.new(char.Torso.Position,h.Parent.Torso.Position).lookVector * force
  586. local bodyforc = Instance.new("BodyForce", h.Parent.Torso)
  587. boom:Play()
  588. bodyforc.force = Vector3.new(0, h.Parent.Torso:GetMass() * 196.1, 0)
  589.  
  590.  
  591. wait(0.2)
  592. x:TakeDamage(5000)
  593. wait()
  594. safe = true
  595. bodyforc:Remove()
  596. h.Parent.Torso.Velocity = stop
  597.  
  598. end
  599. end
  600. end)
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611. local rng = Instance.new("Part", char)
  612. rng.Anchored = true
  613. rng.BrickColor = BrickColor.new("Institutional white")
  614. rng.CanCollide = false
  615. rng.FormFactor = 3
  616. rng.Name = "Ring"
  617. rng.Size = Vector3.new(1, 1, 1)
  618. rng.Transparency = 0.8
  619. rng.TopSurface = 0
  620. rng.BottomSurface = 0
  621. rng.CFrame = char["Left Arm"].CFrame * CFrame.new(0,-2,0)
  622. --rng.Rotation = Vector3.new(math.pi/2,0,0)
  623. rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  624. local rngm = Instance.new("SpecialMesh", rng)
  625. rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
  626. rngm.Scale = Vector3.new(1, 1.3, 2)
  627. wait(0.1)
  628.  
  629. boom2:Play()
  630. coroutine.wrap(function()
  631. for i = 1, 10, .4 do
  632. rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
  633.  
  634. wait()
  635. end
  636. wait()
  637. rng:Destroy()
  638. killbrick:Remove()
  639. wait(0.5)
  640. char.Torso["Left Shoulder"].C0 = org
  641. wait(1)
  642.  
  643. punch = true
  644. wait()
  645. end)()
  646.  
  647.  
  648.  
  649. end
  650.  
  651.  
  652. wait(.1)
  653.  
  654.  
  655. end
  656. end)
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671. m.KeyDown:connect(function(key)
  672. if key == "m" then
  673. if jump == true then
  674. jump = false
  675.  
  676.  
  677. local rng = Instance.new("Part", char)
  678. rng.Anchored = true
  679. rng.BrickColor = BrickColor.new("Institutional white")
  680. rng.CanCollide = false
  681. rng.FormFactor = 3
  682. rng.Name = "Ring"
  683. rng.Size = Vector3.new(1, 1, 1)
  684. rng.Transparency = 0.35
  685. rng.TopSurface = 0
  686. rng.BottomSurface = 0
  687. rng.Position = torso.Position - Vector3.new(0,2,0)
  688. rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  689. local rngm = Instance.new("SpecialMesh", rng)
  690. rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
  691. rngm.Scale = Vector3.new(1, 1.3, 2)
  692. wait(0.1)
  693. BV = Instance.new("BodyVelocity", torso)
  694. BV.maxForce = Vector3.new(0,20000,0)
  695. BV.P = 1000
  696. BV.velocity = Vector3.new(0,100,0)
  697. boom:Play()
  698. coroutine.wrap(function()
  699. for i = 1, 60, 2 do
  700. rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
  701. rng.Transparency = i/60
  702. wait()
  703. end
  704. wait()
  705. rng:Destroy()
  706.  
  707. hum.WalkSpeed = 50
  708. wait(1)
  709.  
  710. for i,v in pairs(torso:GetChildren()) do if v:IsA("BodyVelocity") then
  711. v:Destroy() jumping2 = true falling = true wait(0.3) jumping2 = false falling = false wait(1.7) jump = true hum.WalkSpeed = 16 falling = false
  712. end end
  713. wait()
  714. end)()
  715.  
  716.  
  717.  
  718. end
  719.  
  720.  
  721. wait(.1)
  722.  
  723.  
  724. end
  725. end)
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732. m.KeyDown:connect(function(key)
  733. if key == "n" then
  734.  
  735. if falling == true then
  736. falling = false
  737. if jumping2 == true then
  738. jumping2 = false
  739. jump = false
  740. BV = Instance.new("BodyVelocity", torso)
  741. BV.maxForce = Vector3.new(0,-20000,0)
  742. BV.P = -1000
  743. BV.velocity = Vector3.new(0,-70,0)
  744. wait(0.6)
  745. local rng = Instance.new("Part", char)
  746. rng.Anchored = true
  747. rng.BrickColor = BrickColor.new("Institutional white")
  748. rng.CanCollide = false
  749. rng.FormFactor = 3
  750. rng.Name = "Ring"
  751. rng.Size = Vector3.new(1, 1, 1)
  752. rng.Transparency = 0.35
  753. rng.TopSurface = 0
  754. rng.BottomSurface = 0
  755. rng.Position = torso.Position - Vector3.new(0,2,0)
  756. rng.CFrame = rng.CFrame * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
  757. local rngm = Instance.new("SpecialMesh", rng)
  758. rngm.MeshId = "http://www.roblox.com/asset/?id=3270017"
  759. rngm.Scale = Vector3.new(1, 1.3, 2)
  760.  
  761.  
  762. boom:Play()
  763. coroutine.wrap(function()
  764. for i = 1, 60, 2 do
  765. rngm.Scale = Vector3.new(2 + i*2, 2 + i*2, 1)
  766. rng.Transparency = i/60
  767. wait()
  768. end
  769. wait()
  770. rng:Destroy()
  771.  
  772.  
  773.  
  774.  
  775. for i,v in pairs(torso:GetChildren()) do if v:IsA("BodyVelocity") then
  776. v:Destroy() wait(2) jumping2 = true hum.WalkSpeed = 16
  777. end end
  778. wait()
  779. end)()
  780.  
  781.  
  782.  
  783. end
  784.  
  785.  
  786. wait(.1)
  787.  
  788. end
  789. end
  790. end)
  791. m.KeyDown:connect(function(k)
  792. if k == "f" then
  793. asd3:Stop()
  794. asd2:Stop()
  795. asd4:Stop()
  796. asd6:Stop()
  797. asd5:Stop()
  798. end
  799. end)
  800. wait(5)
  801.  
  802. --NOTE: This version uses a hack to create a second part for shirt textures
  803. -- Mesh behavior may change to where this hack will become un-needed
  804. -- Let me know if you want me to create a toggle for this
  805.  
  806. Player = game.Players.localPlayer
  807.  
  808.  
  809. local function CharacterAdded(Character)
  810. if Character then
  811.  
  812. local R15Model = Instance.new("Model")
  813. R15Model.Name = "R15Model"
  814. R15Model.Parent = Character
  815.  
  816. local function CreateLimb(Name,Color,Size,Transparency,ConnectToLimb,MotorName,C0,C1,MeshId)
  817. local Part = Instance.new("Part")
  818. Part.FormFactor = "Custom"
  819. Part.Size = Size
  820. Part.BrickColor = Color
  821. Part.CanCollide = false
  822. Part.Name = Name
  823. Part.Transparency = (Transparency == 0.001 and 0 or Transparency)
  824. Part.TopSurface = "Smooth"
  825. Part.BottomSurface = "Smooth"
  826.  
  827. local Motor = Instance.new("Motor6D")
  828. Motor.C0 = C0
  829. Motor.C1 = C1
  830. Motor.Part0 = ConnectToLimb
  831. Motor.Part1 = Part
  832. Motor.Name = MotorName
  833. Motor.MaxVelocity = 0.1
  834. Motor.Parent = ConnectToLimb
  835.  
  836. if MeshId then
  837. local Mesh = Instance.new("SpecialMesh")
  838. Mesh.MeshType = "FileMesh"
  839. Mesh.MeshId = MeshId
  840. Mesh.Scale = Vector3.new(0.99,0.99,0.99)
  841. Mesh.Parent = Part
  842. end
  843.  
  844. if MeshId and Transparency == 0.001 then
  845. local ShirtTexturePart = Instance.new("Part")
  846. ShirtTexturePart.FormFactor = "Custom"
  847. ShirtTexturePart.Size = Size
  848. ShirtTexturePart.BrickColor = Color
  849. ShirtTexturePart.CanCollide = false
  850. ShirtTexturePart.Name = "ShirtTexturePart"
  851. ShirtTexturePart.Transparency = Transparency
  852. ShirtTexturePart.TopSurface = "Smooth"
  853. ShirtTexturePart.BottomSurface = "Smooth"
  854.  
  855. local Mesh = Instance.new("SpecialMesh")
  856. Mesh.MeshType = "FileMesh"
  857. Mesh.MeshId = MeshId
  858. Mesh.Parent = ShirtTexturePart
  859.  
  860. local Weld = Instance.new("Weld")
  861. Weld.Part0 = Part
  862. Weld.Part1 = ShirtTexturePart
  863. Weld.Parent = ShirtTexturePart
  864.  
  865. ShirtTexturePart.Parent = Part
  866. end
  867. Part.Parent = R15Model
  868. return Part
  869. end
  870.  
  871. local HumanoidRootPart = CreateLimb("HumanoidRootPart",BrickColor.new("Medium stone grey"),Vector3.new(1,1,1),1,Character.HumanoidRootPart,"RootConnector",CFrame.new(),CFrame.new(0,0.7,0))
  872. local TorsoLower = CreateLimb("TorsoLower",BrickColor.new("Bright blue"),Vector3.new(0.5,0.5,0.5),0.001,HumanoidRootPart,"Root",CFrame.new(0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1),CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366190286")
  873. local TorsoUpper = CreateLimb("TorsoUpper",BrickColor.new("Bright blue"),Vector3.new(0.2,0.74,0.2),0.001,TorsoLower,"Waist",CFrame.new(0, 0.739968002, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),CFrame.new(0, -0.369984001, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366190087")
  874. local Head = CreateLimb("FakeHead",BrickColor.new("Bright yellow"),Vector3.new(1,1,1),0,TorsoUpper,"Neck",CFrame.new(0, 0.566236973, -0.0666489974, 1, 0, 0, 0, 0.993143976, 0.116898, 0, -0.116898, 0.993143976),CFrame.new(0, -0.285073012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366190426")
  875. local LeftArmUpper = CreateLimb("LeftArmUpper",BrickColor.new("Bright yellow"),Vector3.new(0.2,0.536,0.2),0.001,TorsoUpper,"LeftShoulder",CFrame.new(1.50177097, 0.220340997, 0, 0, -0.999044001, -0.0437170006, -1, 0, 0, 0, 0.0437170006, -0.999044001),CFrame.new(0, 0.336115986, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366186808")
  876. local LeftArmLower = CreateLimb("LeftArmLower",BrickColor.new("Bright yellow"),Vector3.new(0.2,0.739,0.2),0.001,LeftArmUpper,"LeftElbow",CFrame.new(0, -0.267791986, 0, 1, 0, 0, 0, 0.998493016, -0.0548710003, 0, 0.0548710003, 0.998493016),CFrame.new(0, 0.369605988, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366187079")
  877. local LeftHand = CreateLimb("LeftHand",BrickColor.new("Bright yellow"),Vector3.new(0.2,0.37,0.2),0.001,LeftArmLower,"LeftWrist",CFrame.new(0, -0.369605988, 0, 1, 0, 0, 0, -1, 0, 0, 0, -1),CFrame.new(0, -0.184802994, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366187331")
  878. local RightArmUpper = CreateLimb("RightArmUpper",BrickColor.new("Bright yellow"),Vector3.new(0.2,0.536,0.2),0.001,TorsoUpper,"RightShoulder",CFrame.new(-1.50049305, 0.219521001, 0, 0, 0.999041975, -0.0437709987, -1, 0, 0, 0, 0.0437709987, 0.999041975),CFrame.new(0, 0.335705996, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366188623")
  879. local RightArmLower = CreateLimb("RightArmLower",BrickColor.new("Bright yellow"),Vector3.new(0.2,0.739,0.2),0.001,RightArmUpper,"RightElbow",CFrame.new(0, -0.296110988, 0, 1, 0, 0, 0, 0.998767972, 0.0496239997, 0, -0.0496239997, 0.998767972),CFrame.new(0, 0.337754011, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366188798")
  880. local RightHand = CreateLimb("RightHand",BrickColor.new("Bright yellow"),Vector3.new(),0.001,RightArmLower,"RightWrist",CFrame.new(0, -0.337754011, 0, 1, 0, 0, 0, -1, 0, 0, 0, -1),CFrame.new(0, -0.168877006, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366189081")
  881. local LeftLegUpper = CreateLimb("LeftLegUpper",BrickColor.new("Br. yellowish green"),Vector3.new(0.2,0.784,0.2),0.001,TorsoLower,"LeftHip",CFrame.new(0.457044005, -0.495086014, 0, 1, 0, 0, 0, 1, -0.000100999998, 0, 0.000100999998, 1),CFrame.new(0, 0.388933986, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366187724")
  882. local LeftLegLower = CreateLimb("LeftLegLower",BrickColor.new("Br. yellowish green"),Vector3.new(0.2,0.803,0.2),0.001,LeftLegUpper,"LeftKnee",CFrame.new(0, -0.388933986, 0, 1, 9.99999997e-007, 0, -9.99999997e-007, 0.991840005, -0.127486005, 0, 0.127486005, 0.991840005),CFrame.new(0, 0.401580006, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366188102")
  883. local LeftFoot = CreateLimb("LeftFoot",BrickColor.new("Br. yellowish green"),Vector3.new(0.2,0.402,0.2),0.001,LeftLegLower,"LeftAnkle",CFrame.new(0, -0.401578993, 0, 1, 0, 0, 0, -1, 0, 0, 0, -1),CFrame.new(0, -0.200790003, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366188387")
  884. local RightLegUpper = CreateLimb("RightLegUpper",BrickColor.new("Br. yellowish green"),Vector3.new(0.2,0.784,0.2),0.001,TorsoLower,"RightHip",CFrame.new(-0.451141, -0.498115987, 0, 1, 0, 0, 0, 0.999954998, 0.0095180003, 0, -0.0095180003, 0.999954998),CFrame.new(0, 0.391921997, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366189770")
  885. local RightLegLower = CreateLimb("RightLegLower",BrickColor.new("Br. yellowish green"),Vector3.new(0.2,0.796,0.2),0.001,RightLegUpper,"RightKnee",CFrame.new(0, -0.391921997, 0, 1, 0, 0, 0, 0.992762029, -0.120096996, 0, 0.120096996, 0.992762029),CFrame.new(0, 0.39814499, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366189509")
  886. local RightFoot = CreateLimb("RightFoot",BrickColor.new("Br. yellowish green"),Vector3.new(0.2, 0.398, 0.2),0.001,RightLegLower,"RightAnkle",CFrame.new(0, -0.39814499, 0, 1, 0, 0, 0, -1, 0, 0, 0, -1),CFrame.new(0, -0.199073002, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),"http://www.roblox.com/asset/?id=366189977")
  887.  
  888. --if Character:WaitForChild("Head"):WaitForChild("Mesh").MeshId ~= "" then
  889. -- Head.MeshId = Character.Head.Mesh.MeshId
  890. --end
  891.  
  892. spawn(function() Character:WaitForChild("Animate").Disabled = false end)
  893.  
  894.  
  895. local function Clear(Name,Alternative,ColorParts)
  896. local Part = Character:WaitForChild(Name)
  897. Part.Transparency = (Name == "Head" and 0.99 or 1)
  898. local function ChildAdded(Ins)
  899. delay(0.05,function()
  900. if Ins.Name == "face" then
  901. if Alternative:FindFirstChild("face") then Alternative:FindFirstChild("face"):Destroy() end
  902. Ins.Parent = Alternative
  903. elseif Ins:IsA("Motor6D") and string.sub(Ins.Name,1,5) ~= "Fake_" then
  904. Ins.Name = "Fake_"..Ins.Name
  905. elseif Ins.Name == "HeadWeld" then
  906. delay(0.05,function()
  907. Ins.Parent = Head
  908. Ins.Part0 = Head
  909. Ins.C1 = CFrame.new(0,-0.15,0.125) * Ins.C1 * CFrame.Angles(0,math.pi,0)
  910. end)
  911. elseif not Ins:IsA("Weld") then
  912. Ins:Destroy()
  913. end
  914. end)
  915. end
  916. for _,Sub in pairs(Part:GetChildren()) do
  917. ChildAdded(Sub)
  918. end
  919. Part.ChildAdded:connect(ChildAdded)
  920.  
  921. local function Color()
  922. for _,Sub in pairs(ColorParts) do
  923. Sub.BrickColor = Part.BrickColor
  924. local TexturePart = Sub:FindFirstChild("ShirtTexturePart")
  925. if TexturePart then
  926. TexturePart.BrickColor = Part.BrickColor
  927. end
  928. end
  929. end
  930. Color()
  931. Part.Changed:connect(Color)
  932. end
  933.  
  934. Clear("HumanoidRootPart",HumanoidRootPart,{HumanoidRootPart})
  935. Clear("Head",Head,{Head})
  936. Clear("Torso",nil,{TorsoLower,TorsoUpper})
  937. Clear("Left Arm",nil,{LeftArmLower,LeftArmUpper,LeftHand})
  938. Clear("Right Arm",nil,{RightArmLower,RightArmUpper,RightHand})
  939. Clear("Left Leg",nil,{LeftLegLower,LeftLegUpper,LeftFoot})
  940. Clear("Right Leg",nil,{RightLegLower,RightLegUpper,RightFoot})
  941.  
  942. local ShirtUsed = false
  943. local function ChildAdded(Ins)
  944. if Ins:IsA("Hat") and string.sub(Ins.Name,1,7) ~= "Scaled_" then
  945. delay(0.05,function()
  946. local Mesh = Ins:WaitForChild("Handle"):WaitForChild("Mesh")
  947. Ins.AttachmentPos = Ins.AttachmentPos
  948. Mesh.Scale = Mesh.Scale
  949. Ins.Name = "Scaled_"..Ins.Name
  950. end)
  951. elseif Ins:IsA("Shirt") then
  952. ShirtUsed = true
  953. TorsoLower.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  954. TorsoUpper.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  955. LeftArmLower.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  956. LeftArmUpper.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  957. LeftHand.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  958. RightArmLower.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  959. RightArmUpper.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  960. RightHand.ShirtTexturePart.Mesh.TextureId = Ins.ShirtTemplate
  961. elseif Ins:IsA("Pants") then
  962. LeftLegUpper.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  963. LeftLegLower.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  964. LeftFoot.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  965. RightLegUpper.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  966. RightLegLower.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  967. RightFoot.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  968. if ShirtUsed ~= true then
  969. TorsoLower.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  970. TorsoUpper.ShirtTexturePart.Mesh.TextureId = Ins.PantsTemplate
  971. end
  972. end
  973. end
  974.  
  975. for _,Sub in pairs(Character:GetChildren()) do
  976. ChildAdded(Sub)
  977. end
  978. Character.ChildAdded:connect(ChildAdded)
  979. end
  980. end
  981.  
  982. CharacterAdded(Player.Character)
  983. Player.CharacterAdded:connect(CharacterAdded)
  984.  
  985. script.Parent = game.Players.LocalPlayer.Character
  986. function waitForChild(parent, childName)
  987. local child = parent:findFirstChild(childName)
  988. if child then return child end
  989. while true do
  990. child = parent.ChildAdded:wait()
  991. if child.Name==childName then return child end
  992. end
  993. end
  994.  
  995. local Figure = script.Parent
  996. local Humanoid = waitForChild(Figure, "Humanoid")
  997. local pose = "Standing"
  998.  
  999. local currentAnim = ""
  1000. local currentAnimInstance = nil
  1001. local currentAnimTrack = nil
  1002. local currentAnimKeyframeHandler = nil
  1003. local currentAnimSpeed = 1.0
  1004. local animTable = {}
  1005. local animNames = {
  1006. idle = {
  1007. { id = "http://www.roblox.com/asset/?id=361250879", weight = 1 },
  1008. { id = "http://www.roblox.com/asset/?id=361250964", weight = 1 },
  1009. { id = "http://www.roblox.com/asset/?id=361250801", weight = 9 }
  1010. },
  1011. walk = {
  1012. { id = "http://www.roblox.com/asset/?id=361250532", weight = 10 }
  1013. },
  1014. run = {
  1015. { id = "http://www.roblox.com/asset/?id=361250532", weight = 10 }
  1016. },
  1017. jump = {
  1018. { id = "http://www.roblox.com/asset/?id=361251250", weight = 10 }
  1019. },
  1020. fall = {
  1021. { id = "http://www.roblox.com/asset/?id=361259102", weight = 10 }
  1022. },
  1023. climb = {
  1024. { id = "http://www.roblox.com/asset/?id=361251073", weight = 10 }
  1025. },
  1026. sit = {
  1027. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  1028. },
  1029. toolnone = {
  1030. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  1031. },
  1032. toolslash = {
  1033. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  1034. -- { id = "slash.xml", weight = 10 }
  1035. },
  1036. toollunge = {
  1037. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  1038. },
  1039. wave = {
  1040. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  1041. },
  1042. point = {
  1043. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  1044. },
  1045. dance = {
  1046. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  1047. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  1048. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  1049. },
  1050. dance2 = {
  1051. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  1052. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  1053. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  1054. },
  1055. dance3 = {
  1056. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1057. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1058. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1059. },
  1060. laugh = {
  1061. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1062. },
  1063. cheer = {
  1064. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1065. },
  1066. }
  1067.  
  1068. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1069. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1070.  
  1071. math.randomseed(tick())
  1072.  
  1073. function configureAnimationSet(name, fileList)
  1074. if (animTable[name] ~= nil) then
  1075. for _, connection in pairs(animTable[name].connections) do
  1076. connection:disconnect()
  1077. end
  1078. end
  1079. animTable[name] = {}
  1080. animTable[name].count = 0
  1081. animTable[name].totalWeight = 0
  1082. animTable[name].connections = {}
  1083.  
  1084. -- check for config values
  1085. local config = script:FindFirstChild(name)
  1086. if (config ~= nil) then
  1087. -- print("Loading anims " .. name)
  1088. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1089. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1090. local idx = 1
  1091. for _, childPart in pairs(config:GetChildren()) do
  1092. if (childPart:IsA("Animation")) then
  1093. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1094. animTable[name][idx] = {}
  1095. animTable[name][idx].anim = childPart
  1096. local weightObject = childPart:FindFirstChild("Weight")
  1097. if (weightObject == nil) then
  1098. animTable[name][idx].weight = 1
  1099. else
  1100. animTable[name][idx].weight = weightObject.Value
  1101. end
  1102. animTable[name].count = animTable[name].count + 1
  1103. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1104. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1105. idx = idx + 1
  1106. end
  1107. end
  1108. end
  1109.  
  1110. -- fallback to defaults
  1111. if (animTable[name].count <= 0) then
  1112. for idx, anim in pairs(fileList) do
  1113. animTable[name][idx] = {}
  1114. animTable[name][idx].anim = Instance.new("Animation")
  1115. animTable[name][idx].anim.Name = name
  1116. animTable[name][idx].anim.AnimationId = anim.id
  1117. animTable[name][idx].weight = anim.weight
  1118. animTable[name].count = animTable[name].count + 1
  1119. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1120. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1121. end
  1122. end
  1123. end
  1124.  
  1125. -- Setup animation objects
  1126. function scriptChildModified(child)
  1127. local fileList = animNames[child.Name]
  1128. if (fileList ~= nil) then
  1129. configureAnimationSet(child.Name, fileList)
  1130. end
  1131. end
  1132.  
  1133. script.ChildAdded:connect(scriptChildModified)
  1134. script.ChildRemoved:connect(scriptChildModified)
  1135.  
  1136.  
  1137. for name, fileList in pairs(animNames) do
  1138. configureAnimationSet(name, fileList)
  1139. end
  1140.  
  1141. -- ANIMATION
  1142.  
  1143. -- declarations
  1144. local toolAnim = "None"
  1145. local toolAnimTime = 0
  1146.  
  1147. local jumpAnimTime = 0
  1148. local jumpAnimDuration = 0.3
  1149.  
  1150. local toolTransitionTime = 0.1
  1151. local fallTransitionTime = 0.0
  1152.  
  1153. -- functions
  1154.  
  1155. function stopAllAnimations()
  1156. local oldAnim = currentAnim
  1157.  
  1158. -- return to idle if finishing an emote
  1159. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1160. oldAnim = "idle"
  1161. end
  1162.  
  1163. currentAnim = ""
  1164. currentAnimInstance = nil
  1165. if (currentAnimKeyframeHandler ~= nil) then
  1166. currentAnimKeyframeHandler:disconnect()
  1167. end
  1168.  
  1169. if (currentAnimTrack ~= nil) then
  1170. currentAnimTrack:Stop()
  1171. currentAnimTrack:Destroy()
  1172. currentAnimTrack = nil
  1173. end
  1174. return oldAnim
  1175. end
  1176.  
  1177. function setAnimationSpeed(speed)
  1178. if speed ~= currentAnimSpeed then
  1179. currentAnimSpeed = speed
  1180. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1181. end
  1182. end
  1183.  
  1184. function keyFrameReachedFunc(frameName)
  1185. if (frameName == "End") then
  1186. -- print("Keyframe : ".. frameName)
  1187.  
  1188. local repeatAnim = currentAnim
  1189. -- return to idle if finishing an emote
  1190. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1191. repeatAnim = "idle"
  1192. end
  1193.  
  1194. local animSpeed = currentAnimSpeed
  1195. playAnimation(repeatAnim, 0.05, Humanoid)
  1196. setAnimationSpeed(animSpeed)
  1197. end
  1198. end
  1199.  
  1200. -- Preload animations
  1201. function playAnimation(animName, transitionTime, humanoid)
  1202.  
  1203. local roll = math.random(1, animTable[animName].totalWeight)
  1204. local origRoll = roll
  1205. local idx = 1
  1206. while (roll > animTable[animName][idx].weight) do
  1207. roll = roll - animTable[animName][idx].weight
  1208. idx = idx + 1
  1209. end
  1210.  
  1211. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1212.  
  1213. local anim = animTable[animName][idx].anim
  1214.  
  1215. -- switch animation
  1216. if (anim ~= currentAnimInstance) then
  1217.  
  1218. if (currentAnimTrack ~= nil) then
  1219. currentAnimTrack:Stop(transitionTime)
  1220. currentAnimTrack:Destroy()
  1221. end
  1222.  
  1223. currentAnimSpeed = 1.0
  1224.  
  1225. -- load it to the humanoid; get AnimationTrack
  1226. currentAnimTrack = humanoid:LoadAnimation(anim)
  1227.  
  1228. -- play the animation
  1229. currentAnimTrack:Play(transitionTime)
  1230. currentAnim = animName
  1231. currentAnimInstance = anim
  1232.  
  1233. -- set up keyframe name triggers
  1234. if (currentAnimKeyframeHandler ~= nil) then
  1235. currentAnimKeyframeHandler:disconnect()
  1236. end
  1237. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1238.  
  1239. end
  1240.  
  1241. end
  1242.  
  1243. -------------------------------------------------------------------------------------------
  1244. -------------------------------------------------------------------------------------------
  1245.  
  1246. local toolAnimName = ""
  1247. local toolAnimTrack = nil
  1248. local toolAnimInstance = nil
  1249. local currentToolAnimKeyframeHandler = nil
  1250.  
  1251. function toolKeyFrameReachedFunc(frameName)
  1252. if (frameName == "End") then
  1253. -- print("Keyframe : ".. frameName)
  1254. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1255. end
  1256. end
  1257.  
  1258.  
  1259. function playToolAnimation(animName, transitionTime, humanoid)
  1260.  
  1261. local roll = math.random(1, animTable[animName].totalWeight)
  1262. local origRoll = roll
  1263. local idx = 1
  1264. while (roll > animTable[animName][idx].weight) do
  1265. roll = roll - animTable[animName][idx].weight
  1266. idx = idx + 1
  1267. end
  1268. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1269. local anim = animTable[animName][idx].anim
  1270.  
  1271. if (toolAnimInstance ~= anim) then
  1272.  
  1273. if (toolAnimTrack ~= nil) then
  1274. toolAnimTrack:Stop()
  1275. toolAnimTrack:Destroy()
  1276. transitionTime = 0
  1277. end
  1278.  
  1279. -- load it to the humanoid; get AnimationTrack
  1280. toolAnimTrack = humanoid:LoadAnimation(anim)
  1281.  
  1282. -- play the animation
  1283. toolAnimTrack:Play(transitionTime)
  1284. toolAnimName = animName
  1285. toolAnimInstance = anim
  1286.  
  1287. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1288. end
  1289. end
  1290.  
  1291. function stopToolAnimations()
  1292. local oldAnim = toolAnimName
  1293.  
  1294. if (currentToolAnimKeyframeHandler ~= nil) then
  1295. currentToolAnimKeyframeHandler:disconnect()
  1296. end
  1297.  
  1298. toolAnimName = ""
  1299. toolAnimInstance = nil
  1300. if (toolAnimTrack ~= nil) then
  1301. toolAnimTrack:Stop()
  1302. toolAnimTrack:Destroy()
  1303. toolAnimTrack = nil
  1304. end
  1305.  
  1306.  
  1307. return oldAnim
  1308. end
  1309.  
  1310. -------------------------------------------------------------------------------------------
  1311. -------------------------------------------------------------------------------------------
  1312.  
  1313.  
  1314. function onRunning(speed)
  1315. if speed > 0.01 then
  1316. playAnimation("walk", 0.1, Humanoid)
  1317. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=361250532" then
  1318. setAnimationSpeed(speed / 14.5)
  1319. end
  1320. pose = "Running"
  1321. else
  1322. playAnimation("idle", 0.1, Humanoid)
  1323. pose = "Standing"
  1324. end
  1325. end
  1326.  
  1327. function onDied()
  1328. pose = "Dead"
  1329. end
  1330.  
  1331. function onJumping()
  1332. playAnimation("jump", 0.1, Humanoid)
  1333. jumpAnimTime = jumpAnimDuration
  1334. pose = "Jumping"
  1335. end
  1336.  
  1337. function onClimbing(speed)
  1338. local scale = 2.0
  1339. playAnimation("climb", 0.1, Humanoid)
  1340. setAnimationSpeed(speed / scale)
  1341. pose = "Climbing"
  1342. end
  1343.  
  1344. function onGettingUp()
  1345. pose = "GettingUp"
  1346. end
  1347.  
  1348. function onFreeFall()
  1349. if (jumpAnimTime <= 0) then
  1350. playAnimation("fall", fallTransitionTime, Humanoid)
  1351. end
  1352. pose = "FreeFall"
  1353. end
  1354.  
  1355. function onFallingDown()
  1356. pose = "FallingDown"
  1357. end
  1358.  
  1359. function onSeated()
  1360. pose = "Seated"
  1361. end
  1362.  
  1363. function onPlatformStanding()
  1364. pose = "PlatformStanding"
  1365. end
  1366.  
  1367. function onSwimming(speed)
  1368. if speed>0 then
  1369. pose = "Running"
  1370. else
  1371. pose = "Standing"
  1372. end
  1373. end
  1374.  
  1375. function getTool()
  1376. for _, kid in ipairs(Figure:GetChildren()) do
  1377. if kid.className == "Tool" then return kid end
  1378. end
  1379. return nil
  1380. end
  1381.  
  1382. function getToolAnim(tool)
  1383. for _, c in ipairs(tool:GetChildren()) do
  1384. if c.Name == "toolanim" and c.className == "StringValue" then
  1385. return c
  1386. end
  1387. end
  1388. return nil
  1389. end
  1390.  
  1391. function animateTool()
  1392.  
  1393. if (toolAnim == "None") then
  1394. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1395. return
  1396. end
  1397.  
  1398. if (toolAnim == "Slash") then
  1399. playToolAnimation("toolslash", 0, Humanoid)
  1400. return
  1401. end
  1402.  
  1403. if (toolAnim == "Lunge") then
  1404. playToolAnimation("toollunge", 0, Humanoid)
  1405. return
  1406. end
  1407. end
  1408.  
  1409. function moveSit()
  1410. RightShoulder.MaxVelocity = 0.15
  1411. LeftShoulder.MaxVelocity = 0.15
  1412. RightShoulder:SetDesiredAngle(3.14 /2)
  1413. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1414. RightHip:SetDesiredAngle(3.14 /2)
  1415. LeftHip:SetDesiredAngle(-3.14 /2)
  1416. end
  1417.  
  1418. local lastTick = 0
  1419.  
  1420. function move(time)
  1421. local amplitude = 1
  1422. local frequency = 1
  1423. local deltaTime = time - lastTick
  1424. lastTick = time
  1425.  
  1426. local climbFudge = 0
  1427. local setAngles = false
  1428.  
  1429. if (jumpAnimTime > 0) then
  1430. jumpAnimTime = jumpAnimTime - deltaTime
  1431. end
  1432.  
  1433. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1434. playAnimation("fall", fallTransitionTime, Humanoid)
  1435. elseif (pose == "Seated") then
  1436. playAnimation("sit", 0.5, Humanoid)
  1437. return
  1438. elseif (pose == "Running") then
  1439. playAnimation("walk", 0.1, Humanoid)
  1440. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1441. -- print("Wha " .. pose)
  1442. stopAllAnimations()
  1443. amplitude = 0.1
  1444. frequency = 1
  1445. setAngles = true
  1446. end
  1447.  
  1448. -- if (setAngles) then
  1449. if (false) then
  1450. desiredAngle = amplitude * math.sin(time * frequency)
  1451.  
  1452. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1453. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1454. RightHip:SetDesiredAngle(-desiredAngle)
  1455. LeftHip:SetDesiredAngle(-desiredAngle)
  1456. end
  1457.  
  1458. -- Tool Animation handling
  1459. local tool = getTool()
  1460. if tool then
  1461.  
  1462. animStringValueObject = getToolAnim(tool)
  1463.  
  1464. if animStringValueObject then
  1465. toolAnim = animStringValueObject.Value
  1466. -- message recieved, delete StringValue
  1467. animStringValueObject.Parent = nil
  1468. toolAnimTime = time + .3
  1469. end
  1470.  
  1471. if time > toolAnimTime then
  1472. toolAnimTime = 0
  1473. toolAnim = "None"
  1474. end
  1475.  
  1476. animateTool()
  1477. else
  1478. stopToolAnimations()
  1479. toolAnim = "None"
  1480. toolAnimInstance = nil
  1481. toolAnimTime = 0
  1482. end
  1483. end
  1484.  
  1485. -- connect events
  1486. Humanoid.Died:connect(onDied)
  1487. Humanoid.Running:connect(onRunning)
  1488. Humanoid.Jumping:connect(onJumping)
  1489. Humanoid.Climbing:connect(onClimbing)
  1490. Humanoid.GettingUp:connect(onGettingUp)
  1491. Humanoid.FreeFalling:connect(onFreeFall)
  1492. Humanoid.FallingDown:connect(onFallingDown)
  1493. Humanoid.Seated:connect(onSeated)
  1494. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1495. Humanoid.Swimming:connect(onSwimming)
  1496.  
  1497. -- setup emote chat hook
  1498. Game.Players.LocalPlayer.Chatted:connect(function(msg)
  1499. local emote = ""
  1500. if (string.sub(msg, 1, 3) == "/e ") then
  1501. emote = string.sub(msg, 4)
  1502. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1503. emote = string.sub(msg, 8)
  1504. end
  1505.  
  1506. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1507. playAnimation(emote, 0.1, Humanoid)
  1508. end
  1509. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  1510. end)
  1511.  
  1512.  
  1513. -- main program
  1514.  
  1515. local runService = game:service("RunService");
  1516.  
  1517. -- print("bottom")
  1518.  
  1519. -- initialize to idle
  1520. playAnimation("idle", 0.1, Humanoid)
  1521. pose = "Standing"
  1522.  
  1523. while Figure.Parent~=nil do
  1524. local _, time = wait(0.1)
  1525. move(time)
  1526. end
  1527. ------------
  1528. -- ~CLarramore 2016
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement