Advertisement
Servbot

Untitled

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