nicholasXPG

Untitled

Feb 17th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.35 KB | None | 0 0
  1. --Created by flipflop8421 (New account: Archonious2)
  2.  
  3. Plrs = game:GetService("Players")
  4. ControlService = game:GetService("ControllerService")
  5. LP = Plrs.LocalPlayer
  6. Mouse = LP:GetMouse()
  7. Char = LP.Character
  8. Tor = Char.Torso
  9. Head = Char.Head
  10. Hum = Char.Humanoid
  11. RJ = Char.HumanoidRootPart.RootJoint
  12. RS = Tor["Right Shoulder"]
  13. LS = Tor["Left Shoulder"]
  14. RH = Tor["Right Hip"]
  15. LH = Tor["Left Hip"]
  16. Neck = Tor["Neck"]
  17. MyControl = ControlService:GetChildren()[1]
  18. Mode = "Normal"
  19. LastJump = 0
  20. TorWeld = nil
  21. WasRunning = false
  22. Running = false
  23. WDown = false
  24. ADown = false
  25. SDown = false
  26. DDown = false
  27.  
  28. function GetWeld(weld)
  29. if weld:findFirstChild("WeldAngle") == nil then
  30. local a = Instance.new("Vector3Value", weld)
  31. a.Name = "WeldAngle"
  32. end
  33. return weld.C0.p, weld.WeldAngle.Value
  34. end
  35.  
  36. function SetWeld(weld, i, loops, origpos, origangle, nextpos, nextangle, smooth)
  37. smooth = smooth or 1
  38. if weld:findFirstChild("WeldAngle") == nil then
  39. local a = Instance.new("Vector3Value", weld)
  40. a.Name = "WeldAngle"
  41. end
  42.  
  43. local perc = (smooth == 1 and math.sin((math.pi/2)/loops*i)) or i/loops
  44.  
  45. local tox, toy, toz = 0, 0, 0
  46. tox = math.abs(origangle.x - nextangle.x) *perc
  47. toy = math.abs(origangle.y - nextangle.y) *perc
  48. toz = math.abs(origangle.z - nextangle.z) *perc
  49. tox = (origangle.x > nextangle.x and -tox) or tox
  50. toy = (origangle.y > nextangle.y and -toy) or toy
  51. toz = (origangle.z > nextangle.z and -toz) or toz
  52.  
  53. local tox2, toy2, toz2 = 0, 0, 0
  54. tox2 = math.abs(origpos.x - nextpos.x) *perc
  55. toy2 = math.abs(origpos.y - nextpos.y) *perc
  56. toz2 = math.abs(origpos.z - nextpos.z) *perc
  57. tox2 = (origpos.x > nextpos.x and -tox2) or tox2
  58. toy2 = (origpos.y > nextpos.y and -toy2) or toy2
  59. toz2 = (origpos.z > nextpos.z and -toz2) or toz2
  60.  
  61. weld.WeldAngle.Value = Vector3.new(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  62. weld.C0 = CFrame.new(origpos.x + tox2, origpos.y + toy2, origpos.z + toz2) * CFrame.Angles(origangle.x + tox, origangle.y + toy, origangle.z + toz)
  63. end
  64.  
  65. function RunAnimArms()
  66. coroutine.resume(coroutine.create(function()
  67. local LSPos, LSAng = GetWeld(LS)
  68. local RSPos, RSAng = GetWeld(RS)
  69. while wait(0) do
  70. if Mode == "Normal" then
  71. if Running == true then
  72. coroutine.resume(coroutine.create(function()
  73. LSPos, LSAng = GetWeld(LS)
  74. for i = 1, 5 do
  75. if Running == false or Mode ~= "Normal" then
  76. break
  77. end
  78. SetWeld(LS, i, 5, LSPos, LSAng, Vector3.new(-1.5, 0.35, -0.23), Vector3.new(math.rad(-67.5), 0, 0))
  79. wait(0)
  80. end
  81. if Running == false then
  82. return
  83. end
  84. LSPos, LSAng = GetWeld(LS)
  85. for i = 1, 5 do
  86. if Running == false or Mode ~= "Normal" then
  87. break
  88. end
  89. SetWeld(LS, i, 5, LSPos, LSAng, Vector3.new(-1.5, 0.35, -0.23), Vector3.new(math.rad(22.5), 0, 0))
  90. wait(0)
  91. end
  92. end))
  93. RSPos, RSAng = GetWeld(RS)
  94. for i = 1, 5 do
  95. if Running == false or Mode ~= "Normal" then
  96. break
  97. end
  98. SetWeld(RS, i, 5, RSPos, RSAng, Vector3.new(1.5, 0.35, -0.23), Vector3.new(math.rad(22.5), 0, 0))
  99. wait(0)
  100. end
  101. RSPos, RSAng = GetWeld(RS)
  102. for i = 1, 5 do
  103. if Running == false or Mode ~= "Normal" then
  104. break
  105. end
  106. SetWeld(RS, i, 5, RSPos, RSAng, Vector3.new(1.5, 0.35, -0.23), Vector3.new(math.rad(-67.5), 0, 0))
  107. wait(0)
  108. end
  109. else
  110. coroutine.resume(coroutine.create(function()
  111. LSPos, LSAng = GetWeld(LS)
  112. for i = 1, 30 do
  113. if WDown == true or ADown == true or SDown == true or DDown == true then
  114. Running = true
  115. break
  116. end
  117. SetWeld(LS, i, 30, LSPos, LSAng, Vector3.new(-1.5, 0.5, 0), Vector3.new(0, 0, math.rad(-8.4375)))
  118. wait(0)
  119. end
  120. LSPos, LSAng = GetWeld(LS)
  121. for i = 1, 30 do
  122. if WDown == true or ADown == true or SDown == true or DDown == true then
  123. Running = true
  124. break
  125. end
  126. SetWeld(LS, i, 30, LSPos, LSAng, Vector3.new(-1.5, 0.5, 0), Vector3.new(0, 0, 0))
  127. wait(0)
  128. end
  129. end))
  130. RSPos, RSAng = GetWeld(RS)
  131. for i = 1, 30 do
  132. if WDown == true or ADown == true or SDown == true or DDown == true then
  133. Running = true
  134. break
  135. end
  136. SetWeld(RS, i, 30, RSPos, RSAng, Vector3.new(1.5, 0.5, 0), Vector3.new(0, 0, math.rad(8.4375)))
  137. wait(0)
  138. end
  139. RSPos, RSAng = GetWeld(RS)
  140. for i = 1, 30 do
  141. if WDown == true or ADown == true or SDown == true or DDown == true then
  142. Running = true
  143. break
  144. end
  145. SetWeld(RS, i, 30, RSPos, RSAng, Vector3.new(1.5, 0.5, 0), Vector3.new(0, 0, 0))
  146. wait(0)
  147. end
  148. end
  149. end
  150. end
  151. end))
  152. end
  153.  
  154. function RunAnimLegs()
  155. coroutine.resume(coroutine.create(function()
  156. local LHPos, LHAng = GetWeld(LH)
  157. local RHPos, RHAng = GetWeld(RH)
  158. while wait(0) do
  159. if Mode == "Normal" then
  160. if Running == true then
  161. coroutine.resume(coroutine.create(function()
  162. LHPos, LHAng = GetWeld(LH)
  163. for i = 1, 5 do
  164. if Running == false or Mode ~= "Normal" then
  165. break
  166. end
  167. SetWeld(LH, i, 5, LHPos, LHAng, Vector3.new(-0.5, -0.85, 0.5), Vector3.new(math.rad(22.5), 0, 0))
  168. wait(0)
  169. end
  170. if Running == false then
  171. return
  172. end
  173. LHPos, LHAng = GetWeld(LH)
  174. for i = 1, 5 do
  175. if Running == false or Mode ~= "Normal" then
  176. break
  177. end
  178. SetWeld(LH, i, 5, LHPos, LHAng, Vector3.new(-0.5, -0.85, 0.5), Vector3.new(math.rad(-67.5), 0, 0))
  179. wait(0)
  180. end
  181. end))
  182. RHPos, RHAng = GetWeld(RH)
  183. for i = 1, 5 do
  184. if Running == false or Mode ~= "Normal" then
  185. break
  186. end
  187. SetWeld(RH, i, 5, RHPos, RHAng, Vector3.new(0.5, -0.85, 0.5), Vector3.new(math.rad(-67.5), 0, 0))
  188. wait(0)
  189. end
  190. RHPos, RHAng = GetWeld(RH)
  191. for i = 1, 5 do
  192. if Running == false or Mode ~= "Normal" then
  193. break
  194. end
  195. SetWeld(RH, i, 5, RHPos, RHAng, Vector3.new(0.5, -0.85, 0.5), Vector3.new(math.rad(22.5), 0, 0))
  196. wait(0)
  197. end
  198. else
  199. coroutine.resume(coroutine.create(function()
  200. LHPos, LHAng = GetWeld(LH)
  201. for i = 1, 30 do
  202. if WDown == true or ADown == true or SDown == true or DDown == true then
  203. Running = true
  204. break
  205. end
  206. SetWeld(LH, i, 30, LHPos, LHAng, Vector3.new(-0.5, -1, 0.04), Vector3.new(0, 0, math.rad(-8.4375)))
  207. wait(0)
  208. end
  209. LHPos, LHAng = GetWeld(LH)
  210. for i = 1, 30 do
  211. if WDown == true or ADown == true or SDown == true or DDown == true then
  212. Running = true
  213. break
  214. end
  215. SetWeld(LH, i, 30, LHPos, LHAng, Vector3.new(-0.5, -1, 0.04), Vector3.new(0, 0, 0))
  216. wait(0)
  217. end
  218. end))
  219. RHPos, RHAng = GetWeld(RH)
  220. for i = 1, 30 do
  221. if WDown == true or ADown == true or SDown == true or DDown == true then
  222. Running = true
  223. break
  224. end
  225. SetWeld(RH, i, 30, RHPos, RHAng, Vector3.new(0.5, -1, 0.04), Vector3.new(0, 0, math.rad(8.4375)))
  226. wait(0)
  227. end
  228. RHPos, RHAng = GetWeld(RH)
  229. for i = 1, 30 do
  230. if WDown == true or ADown == true or SDown == true or DDown == true then
  231. Running = true
  232. break
  233. end
  234. SetWeld(RH, i, 30, RHPos, RHAng, Vector3.new(0.5, -1, 0.04), Vector3.new(0, 0, 0))
  235. wait(0)
  236. end
  237. end
  238. end
  239. end
  240. end))
  241. end
  242.  
  243. function RunAnimFlip()
  244. end
  245.  
  246. function RunAnimDive()
  247. coroutine.resume(coroutine.create(function()
  248. local TorPos, TorAng = GetWeld(TorWeld)
  249. local LHPos, LHAng = GetWeld(LH)
  250. local RHPos, RHAng = GetWeld(RH)
  251. local LSPos, LSAng = GetWeld(LS)
  252. local RSPos, RSAng = GetWeld(RS)
  253. Hum.PlatformStand = true
  254. local StopBV = false
  255. local BV = Instance.new("BodyVelocity", Tor)
  256. BV.maxForce = Vector3.new(1/0, 1/0, 1/0)
  257. BV.P = 1000
  258. coroutine.wrap(function()
  259. while StopBV == false do
  260. wait(0)
  261. BV.velocity = ((Tor.CFrame * CFrame.new(0, 1e+9, 0)).p - Tor.Position).unit * 50
  262. end
  263. end)()
  264. coroutine.resume(coroutine.create(function()
  265. LHPos, LHAng = GetWeld(LH)
  266. for i = 1, 15 do
  267. SetWeld(LH, i, 15, LHPos, LHAng, Vector3.new(-0.5, 0, 0.95), Vector3.new(math.rad(-84.375), 0, math.rad(-11.25)))
  268. wait(0)
  269. end
  270. end))
  271. coroutine.resume(coroutine.create(function()
  272. RHPos, RHAng = GetWeld(RH)
  273. for i = 1, 15 do
  274. SetWeld(RH, i, 15, RHPos, RHAng, Vector3.new(0.5, 0, 0.95), Vector3.new(math.rad(-84.375), 0, math.rad(11.25)))
  275. wait(0)
  276. end
  277. end))
  278. coroutine.resume(coroutine.create(function()
  279. LSPos, LSAng = GetWeld(LS)
  280. for i = 1, 15 do
  281. SetWeld(LS, i, 15, LSPos, LSAng, Vector3.new(-1.5, 0, -0.5), Vector3.new(math.rad(-84.375), 0, 0))
  282. wait(0)
  283. end
  284. end))
  285. coroutine.resume(coroutine.create(function()
  286. RSPos, RSAng = GetWeld(RS)
  287. for i = 1, 15 do
  288. SetWeld(RS, i, 15, RSPos, RSAng, Vector3.new(1.5, 0, -0.5), Vector3.new(math.rad(-84.375), 0, 0))
  289. wait(0)
  290. end
  291. end))
  292. local AttachWeld = Instance.new("Weld")
  293. AttachWeld.Name = "AttachWeld"
  294. AttachWeld.Part0 = Tor
  295. AttachWeld.Part1 = FakeTor
  296. AttachWeld.C0 = CFrame.Angles(math.rad(90), 0, 0)
  297. AttachWeld.Parent = Tor
  298. TorPos, TorAng = GetWeld(TorWeld)
  299. local AttachPos, AttachAng = GetWeld(AttachWeld)
  300. local BG = Instance.new("BodyGyro", Tor)
  301. BG.maxTorque = Vector3.new(1/0, 1/0, 1/0)
  302. BG.D = 100
  303. local TorsCF = Tor.CFrame
  304. local HitFloor = false
  305. coroutine.resume(coroutine.create(function()
  306. while HitFloor == false do
  307. local MyRay = Ray.new(Head.Position, Head.CFrame:vectorToWorldSpace(Vector3.new(0, 2, 0)) * 1)
  308. local Obj, Pos = Workspace:FindPartOnRay(MyRay, Char)
  309. if Obj ~= nil then
  310. HitFloor = true
  311. end
  312. wait(0)
  313. end
  314. end))
  315. local OrigWaitNum = 5
  316. local NewWaitNum = 3
  317. local WaitNum = OrigWaitNum
  318. local Iter = 360/(135/OrigWaitNum)
  319. for i = 1, 135, WaitNum do
  320. BG.cframe = TorsCF * CFrame.Angles(math.rad(-i), math.rad(Iter), 0)
  321. if i <= 45 then
  322. WaitNum = OrigWaitNum
  323. elseif i >= 90 then
  324. if WaitNum == NewWaitNum then
  325. coroutine.resume(coroutine.create(function()
  326. LSPos, LSAng = GetWeld(LS)
  327. for i = 1, 20 do
  328. SetWeld(LS, i, 20, LSPos, LSAng, Vector3.new(-1.5, 0, -0.5), Vector3.new(math.rad(84.375), 0, 0))
  329. wait(0)
  330. end
  331. end))
  332. coroutine.resume(coroutine.create(function()
  333. RSPos, RSAng = GetWeld(RS)
  334. for i = 1, 20 do
  335. SetWeld(RS, i, 20, RSPos, RSAng, Vector3.new(1.5, 0, -0.5), Vector3.new(math.rad(84.375), 0, 0))
  336. wait(0)
  337. end
  338. end))
  339. end
  340. WaitNum = OrigWaitNum
  341. elseif i >= 45 then
  342. WaitNum = NewWaitNum
  343. end
  344. Iter = Iter + 360/(135/OrigWaitNum)
  345. wait(0)
  346. end
  347. repeat wait(0) until HitFloor == true
  348. StopBV = true
  349. wait(0)
  350. BV.velocity = (((Tor.CFrame * CFrame.Angles(math.rad(-22.5), 0, 0)) * CFrame.new(0, 1e+9, 1e+9)).p - (Tor.CFrame * CFrame.Angles(math.rad(-22.5), 0, 0)).p).unit * 50
  351. local TorsCF = Tor.CFrame
  352. coroutine.resume(coroutine.create(function()
  353. NeckPos, NeckAng = GetWeld(Neck)
  354. for i = 1, 7 do
  355. SetWeld(Neck, i, 7, NeckPos, NeckAng, Vector3.new(0, 1.5, -0.75), Vector3.new(math.rad(-45), 0, 0))
  356. wait(0)
  357. end
  358. for i = 1, 7 do
  359. SetWeld(Neck, i, 7, NeckPos, NeckAng, Vector3.new(0, 2, 0), Vector3.new(0, 0, 0))
  360. wait(0)
  361. end
  362. end))
  363. coroutine.resume(coroutine.create(function()
  364. LHPos, LHAng = GetWeld(LH)
  365. for i = 1, 7 do
  366. SetWeld(LH, i, 7, LHPos, LHAng, Vector3.new(-0.5, -1, 0), Vector3.new(math.rad(-90), 0, 0))
  367. wait(0)
  368. end
  369. end))
  370. coroutine.resume(coroutine.create(function()
  371. RHPos, RHAng = GetWeld(RH)
  372. for i = 1, 7 do
  373. SetWeld(RH, i, 7, RHPos, RHAng, Vector3.new(0.5, -1, 0), Vector3.new(math.rad(-90), 0, 0))
  374. wait(0)
  375. end
  376. end))
  377. coroutine.resume(coroutine.create(function()
  378. LSPos, LSAng = GetWeld(LS)
  379. for i = 1, 7 do
  380. SetWeld(LS, i, 7, LSPos, LSAng, Vector3.new(-1.5, 0, -0.5), Vector3.new(math.rad(-22.5), 0, math.rad(11.25)))
  381. wait(0)
  382. end
  383. end))
  384. coroutine.resume(coroutine.create(function()
  385. RSPos, RSAng = GetWeld(RS)
  386. for i = 1, 7 do
  387. SetWeld(RS, i, 7, RSPos, RSAng, Vector3.new(1.5, 0, -0.5), Vector3.new(math.rad(-22.5), 0, math.rad(-11.25)))
  388. wait(0)
  389. end
  390. end))
  391. for i = 1, 202.5, 20 do
  392. BG.cframe = TorsCF * CFrame.Angles(math.rad(-i), 0, 0)
  393. wait(0)
  394. end
  395. BG:Destroy()
  396. TorPos, TorAng = GetWeld(TorWeld)
  397. NeckPos, NeckAng = GetWeld(Neck)
  398. LHPos, LHAng = GetWeld(LH)
  399. RHPos, RHAng = GetWeld(RH)
  400. LSPos, LSAng = GetWeld(LS)
  401. RSPos, RSAng = GetWeld(RS)
  402. AttachWeld:Destroy()
  403. SetWeld(TorWeld, 1, 1, TorPos, TorAng, Vector3.new(), Vector3.new())
  404. SetWeld(Neck, 1, 1, NeckPos, NeckAng, Vector3.new(0, 2, 0), Vector3.new())
  405. SetWeld(LH, 1, 1, LHPos, LHAng, Vector3.new(-0.5, 0, -1.04), Vector3.new(0, 0, 0))
  406. SetWeld(RH, 1, 1, RHPos, RHAng, Vector3.new(0.5, 0, -1.04), Vector3.new(0, 0, 0))
  407. SetWeld(LS, 1, 1, LSPos, LSAng, Vector3.new(-1.5, 0.5, 0), Vector3.new(math.rad(67.5), 0, math.rad(11.25)))
  408. SetWeld(RS, 1, 1, RSPos, RSAng, Vector3.new(1.5, 0.5, 0), Vector3.new(math.rad(67.5), 0, math.rad(-11.25)))
  409. WasRunning = false
  410. Mode = "Normal"
  411. BV.velocity = ((Tor.CFrame * CFrame.new(0, -1e+9, 0)).p - Tor.CFrame.p).unit * 50
  412. Hum.PlatformStand = false
  413. wait()
  414. BV:Destroy()
  415. end))
  416. end
  417.  
  418. function RunAnimObj()
  419. coroutine.resume(coroutine.create(function()
  420. while wait(0) do
  421. if Running == true and Mode == "Normal" then
  422. local MyRay = Ray.new((Tor.CFrame * CFrame.Angles(math.rad(22.5), 0, 0)).p, (Tor.CFrame * CFrame.Angles(math.rad(22.5), 0, 0)):vectorToWorldSpace(Vector3.new(0, 0, -6)) * 1)
  423. local Obj, Pos = Workspace:FindPartOnRay(MyRay, Char)
  424. if Obj ~= nil then
  425. Mode = "Vaulting"
  426. local NeckPos, NeckAng = GetWeld(Neck)
  427. local TorPos, TorAng = GetWeld(TorWeld)
  428. local LHPos, LHAng = GetWeld(LH)
  429. local RHPos, RHAng = GetWeld(RH)
  430. local LSPos, LSAng = GetWeld(LS)
  431. local RSPos, RSAng = GetWeld(RS)
  432. Hum.PlatformStand = true
  433. local StopBG = false
  434. local StopBV = false
  435. local TorCF = Tor.CFrame * CFrame.Angles(math.rad(22.5), 0, 0)
  436. local ObjCF = Obj.CFrame * CFrame.new(0, 1e+9, 0)
  437. local BG = Instance.new("BodyGyro", Tor)
  438. BG.maxTorque = Vector3.new(1/0, 1/0, 1/0)
  439. BG.D = 100
  440. coroutine.wrap(function()
  441. while StopBG == false do
  442. BG.cframe = TorCF * CFrame.new(0, 0, -1e+9)
  443. wait(0)
  444. end
  445. end)()
  446. local BV = Instance.new("BodyVelocity", Tor)
  447. BV.maxForce = Vector3.new(1/0, 1/0, 1/0)
  448. BV.P = 1000
  449. coroutine.wrap(function()
  450. while StopBV == false do
  451. BV.velocity = (TorCF.p - (TorCF * CFrame.new(0, -1e+9, 0)).p).unit * 50
  452. wait(0)
  453. end
  454. end)()
  455. local AttachWeld = Instance.new("Weld")
  456. AttachWeld.Name = "AttachWeld"
  457. AttachWeld.Part0 = Tor
  458. AttachWeld.Part1 = FakeTor
  459. AttachWeld.C0 = CFrame.Angles(math.rad(90), 0, 0)
  460. AttachWeld.Parent = Tor
  461. coroutine.resume(coroutine.create(function()
  462. LHPos, LHAng = GetWeld(LH)
  463. for i = 1, 3 do
  464. SetWeld(LH, i, 3, LHPos, LHAng, Vector3.new(-0.5, 0, 1), Vector3.new(math.rad(-90), 0, math.rad(-5.625)))
  465. wait(0)
  466. end
  467. end))
  468. coroutine.resume(coroutine.create(function()
  469. RHPos, RHAng = GetWeld(RH)
  470. for i = 1, 3 do
  471. SetWeld(RH, i, 3, RHPos, RHAng, Vector3.new(0.5, 0, 1), Vector3.new(math.rad(-90), 0, math.rad(5.625)))
  472. wait(0)
  473. end
  474. end))
  475. coroutine.resume(coroutine.create(function()
  476. LSPos, LSAng = GetWeld(LS)
  477. for i = 1, 3 do
  478. SetWeld(LS, i, 3, LSPos, LSAng, Vector3.new(-1.5, -1, -0.5), Vector3.new(0, 0, math.rad(78.75)))
  479. wait(0)
  480. end
  481. end))
  482. RSPos, RSAng = GetWeld(RS)
  483. for i = 1, 3 do
  484. SetWeld(RS, i, 3, RSPos, RSAng, Vector3.new(1.5, -1, -0.5), Vector3.new(0, 0, math.rad(-78.75)))
  485. wait(0)
  486. end
  487. local MyRay2 = nil
  488. local Obj2, Pos2 = nil, nil
  489. repeat
  490. MyRay2 = Ray.new((Tor.CFrame).p, (Tor.CFrame):vectorToWorldSpace(Vector3.new(0, 0, -10)) * 1)
  491. Obj2, Pos2 = Workspace:FindPartOnRay(MyRay2, Char)
  492. wait(0)
  493. until Obj2 == nil
  494. local TorsCF2 = Tor.CFrame * CFrame.Angles(math.rad(22.5), 0, 0)
  495. coroutine.resume(coroutine.create(function()
  496. NeckPos, NeckAng = GetWeld(Neck)
  497. for i = 1, 7 do
  498. SetWeld(Neck, i, 7, NeckPos, NeckAng, Vector3.new(0, 1.5, -0.75), Vector3.new(math.rad(-45), 0, 0))
  499. wait(0)
  500. end
  501. for i = 1, 7 do
  502. SetWeld(Neck, i, 7, NeckPos, NeckAng, Vector3.new(0, 2, 0), Vector3.new(0, 0, 0))
  503. wait(0)
  504. end
  505. end))
  506. coroutine.resume(coroutine.create(function()
  507. LHPos, LHAng = GetWeld(LH)
  508. for i = 1, 7 do
  509. SetWeld(LH, i, 7, LHPos, LHAng, Vector3.new(-0.5, -1, 0), Vector3.new(math.rad(-90), 0, 0))
  510. wait(0)
  511. end
  512. end))
  513. coroutine.resume(coroutine.create(function()
  514. RHPos, RHAng = GetWeld(RH)
  515. for i = 1, 7 do
  516. SetWeld(RH, i, 7, RHPos, RHAng, Vector3.new(0.5, -1, 0), Vector3.new(math.rad(-90), 0, 0))
  517. wait(0)
  518. end
  519. end))
  520. coroutine.resume(coroutine.create(function()
  521. LSPos, LSAng = GetWeld(LS)
  522. for i = 1, 7 do
  523. SetWeld(LS, i, 7, LSPos, LSAng, Vector3.new(-1.5, 0, -0.5), Vector3.new(math.rad(-22.5), 0, math.rad(11.25)))
  524. wait(0)
  525. end
  526. end))
  527. coroutine.resume(coroutine.create(function()
  528. RSPos, RSAng = GetWeld(RS)
  529. for i = 1, 7 do
  530. SetWeld(RS, i, 7, RSPos, RSAng, Vector3.new(1.5, 0, -0.5), Vector3.new(math.rad(-22.5), 0, math.rad(-11.25)))
  531. wait(0)
  532. end
  533. end))
  534. StopBG = true
  535. StopBV = true
  536. BV.velocity = (TorCF.p - (TorCF * CFrame.new(0, 0, 1e+9)).p).unit * 25
  537. for i = 1, 360, 30 do
  538. BG.cframe = TorsCF2 * CFrame.Angles(math.rad(-i), 0, 0)
  539. wait(0)
  540. end
  541. BG:Destroy()
  542. TorPos, TorAng = GetWeld(TorWeld)
  543. NeckPos, NeckAng = GetWeld(Neck)
  544. LHPos, LHAng = GetWeld(LH)
  545. RHPos, RHAng = GetWeld(RH)
  546. LSPos, LSAng = GetWeld(LS)
  547. RSPos, RSAng = GetWeld(RS)
  548. AttachWeld:Destroy()
  549. SetWeld(TorWeld, 1, 1, TorPos, TorAng, Vector3.new(), Vector3.new())
  550. SetWeld(Neck, 1, 1, NeckPos, NeckAng, Vector3.new(0, 2, 0), Vector3.new())
  551. SetWeld(LH, 1, 1, LHPos, LHAng, Vector3.new(-0.5, 0, -1.04), Vector3.new(0, 0, 0))
  552. SetWeld(RH, 1, 1, RHPos, RHAng, Vector3.new(0.5, 0, -1.04), Vector3.new(0, 0, 0))
  553. SetWeld(LS, 1, 1, LSPos, LSAng, Vector3.new(-1.5, 0.5, 0), Vector3.new(math.rad(67.5), 0, math.rad(11.25)))
  554. SetWeld(RS, 1, 1, RSPos, RSAng, Vector3.new(1.5, 0.5, 0), Vector3.new(math.rad(67.5), 0, math.rad(-11.25)))
  555. WasRunning = false
  556. Mode = "Normal"
  557. Hum.PlatformStand = false
  558. BV:Destroy()
  559. end
  560. end
  561. end
  562. end))
  563. end
  564.  
  565. function RunAnimTorso()
  566. coroutine.resume(coroutine.create(function()
  567. while wait(0) do
  568. if Mode == "Normal" then
  569. NeckPos, NeckAng = GetWeld(Neck)
  570. TorPos, TorAng = GetWeld(TorWeld)
  571. if Running == true and WasRunning == false then
  572. WasRunning = true
  573. for i = 1, 5 do
  574. if Running == false then
  575. break
  576. end
  577. SetWeld(TorWeld, i, 5, TorPos, TorAng, Vector3.new(), Vector3.new(math.rad(-22.5), 0, 0))
  578. wait(0)
  579. end
  580. elseif Running == false and WasRunning == true then
  581. WasRunning = false
  582. for i = 1, 30 do
  583. if Running == true then
  584. break
  585. end
  586. SetWeld(TorWeld, i, 30, TorPos, TorAng, Vector3.new(), Vector3.new())
  587. SetWeld(Neck, i, 30, NeckPos, NeckAng, Vector3.new(0, 2, 0), Vector3.new())
  588. wait(0)
  589. end
  590. end
  591. end
  592. end
  593. end))
  594. end
  595.  
  596. function MoveTorso()
  597. local RJP = RJ.Parent
  598. Tor.Archivable = true
  599. RJ.Archivable = true
  600. FakeTor = Tor:Clone()
  601. FakeTor.Name = "AngleStartPoint"
  602. FakeTor.CanCollide = false
  603. FakeTor.TopSurface = "Smooth"
  604. FakeTor.BottomSurface = "Smooth"
  605. FakeTor.BackSurface = "Smooth"
  606. FakeTor.FrontSurface = "Smooth"
  607. FakeTor.LeftSurface = "Smooth"
  608. FakeTor.RightSurface = "Smooth"
  609. FakeTor.Transparency = 1
  610. FakeTor.Parent = Char
  611. FakeRJ = RJ:Clone()
  612. FakeRJ.Name = "FakeRootJoint"
  613. FakeRJ.Part1 = FakeTor
  614. FakeRJ.Part0 = RJP
  615. FakeRJ.Parent = RJP
  616. for _,v in pairs(Tor:GetChildren()) do
  617. if v.Name:find("Shoulder") or v.Name:find("Hip") then
  618. v.Part0 = FakeTor
  619. end
  620. end
  621. TorWeld = Instance.new("Weld")
  622. TorWeld.Name = "FakeTorsoWeld"
  623. TorWeld.Part0 = RJP
  624. TorWeld.Part1 = Tor
  625. TorWeld.C0 = CFrame.new(0, 0, 0)
  626. TorWeld.Parent = RJP
  627. RJ:Destroy()
  628. RJ = FakeRJ
  629. end
  630.  
  631. Mouse.KeyDown:connect(function(Key)
  632. Key = Key:lower()
  633. if Key == "w" then
  634. WDown = true
  635. elseif Key == "a" then
  636. ADown = true
  637. elseif Key == "s" then
  638. SDown = true
  639. elseif Key == "d" then
  640. DDown = true
  641. elseif Key == "\32" and Running == true and Mode == "Normal" then
  642. Mode = "Diving"
  643. RunAnimDive()
  644. end
  645. end)
  646.  
  647. Mouse.KeyUp:connect(function(Key)
  648. Key = Key:lower()
  649. if Key == "w" then
  650. WDown = false
  651. elseif Key == "a" then
  652. ADown = false
  653. elseif Key == "s" then
  654. SDown = false
  655. elseif Key == "d" then
  656. DDown = false
  657. end
  658. end)
  659.  
  660. coroutine.resume(coroutine.create(function()
  661. while wait(0) do
  662. if WDown == true or ADown == true or SDown == true or DDown == true then
  663. Running = true
  664. else
  665. Running = false
  666. end
  667. end
  668. end))
  669.  
  670. Char.Animate.Disabled = true
  671. Hum.WalkSpeed = 0
  672. SetWeld(RS, 1, 1, Vector3.new(), Vector3.new(), Vector3.new(1.5, 0.5, 0), Vector3.new())
  673. SetWeld(LS, 1, 1, Vector3.new(), Vector3.new(), Vector3.new(-1.5, 0.5, 0), Vector3.new())
  674. SetWeld(RH, 1, 1, Vector3.new(), Vector3.new(), Vector3.new(0.5, -1, 0.04), Vector3.new())
  675. SetWeld(LH, 1, 1, Vector3.new(), Vector3.new(), Vector3.new(-0.5, -1, 0.04), Vector3.new())
  676. SetWeld(Neck, 1, 1, Vector3.new(), Vector3.new(), Vector3.new(0, 2, 0), Vector3.new())
  677. LS.C1 = CFrame.new(0, 0.5, 0)
  678. RS.C1 = CFrame.new(0, 0.5, 0)
  679. LH.C1 = CFrame.new(0, 1, 0)
  680. RH.C1 = CFrame.new(0, 1, 0)
  681. Neck.C1 = CFrame.new(0, 0.5, 0)
  682. wait(.1)
  683. MoveTorso()
  684. coroutine.wrap(function()
  685. RunAnimTorso()
  686. end)()
  687. coroutine.wrap(function()
  688. RunAnimLegs()
  689. end)()
  690. coroutine.wrap(function()
  691. RunAnimObj()
  692. end)()
  693. RunAnimArms()
  694. wait(0)
  695. Hum.WalkSpeed = 50
Add Comment
Please, Sign In to add comment