Advertisement
Pukaciu

parkour archer

Jul 26th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[ C o n t r o l s : Made by Tollonis
  2. E - Draw arrow (press E again to put it back)
  3. Left Click - Fire
  4. Z - Equip/Unequip
  5.  
  6. As always, feel free to DM me with suggestions or bugs. ]]--
  7.  
  8. wait()
  9. player = game.Players.LocalPlayer
  10. char = player.Character
  11. mouse = player:GetMouse()
  12.  
  13. print("WHAT UP")
  14.  
  15. armed = false
  16. canfire = false
  17. enabled = true
  18. equipped = false
  19.  
  20. mouse.Icon = "rbxassetid://311756275"
  21.  
  22. rightshoulder = char.Torso["Right Shoulder"]:Clone()
  23. leftshoulder = char.Torso["Left Shoulder"]:Clone()
  24.  
  25. hed = Instance.new("Weld", char.Torso)
  26. hed.Part0 = char.Torso
  27. hed.Part1 = char.Head
  28. hed.C0 = CFrame.new(0, 1.55, 0) * CFrame.Angles(0, 0, 0)
  29.  
  30. tors = Instance.new("Weld", char.HumanoidRootPart)
  31. tors.Part0 = char.HumanoidRootPart
  32. tors.Part1 = char.Torso
  33. tors.C0 = CFrame.new(0, 0, 0) * CFrame.new(0, 0, 0)
  34.  
  35. -- the bow stuff
  36.  
  37. bow = Instance.new("Model")
  38. bow.Parent = game.Workspace
  39. bow.Name = "bow"
  40.  
  41. handle = Instance.new("Part")
  42. handle.CFrame = CFrame.new(Vector3.new(-48.1999893, 2.79998732, -58.2000122)) * CFrame.Angles(-3.1415927410126, 0, -0)
  43. handle.Size = Vector3.new(0.200000003, 1.20000005, 0.200000003)
  44. handle.BrickColor = BrickColor.new("Really black")
  45. handle.Friction = 0.30000001192093
  46. handle.Shape = Enum.PartType.Block
  47. handle.Name = "Handle"
  48. handle.Parent = bow
  49. handle.CanCollide = false
  50.  
  51. leg2 = Instance.new("Part")
  52. leg2.CFrame = CFrame.new(Vector3.new(-48.1999931, 1.25002313, -58.2000008)) * CFrame.Angles(-3.1415927410126, 0, -0)
  53. leg2.Size = Vector3.new(0.200000003, 1.90000021, 0.200000003)
  54. leg2.BrickColor = BrickColor.new("Really black")
  55. leg2.Friction = 0.30000001192093
  56. leg2.Shape = Enum.PartType.Block
  57. leg2.Name = "Leg2"
  58. leg2.Parent = bow
  59. leg2.CanCollide = false
  60.  
  61. cap2 = Instance.new("Part")
  62. cap2.CFrame = CFrame.new(Vector3.new(-48.2000046, 0.300019979, -58.2000008)) * CFrame.Angles(1.5707963705063, 0, -0)
  63. cap2.TopSurface = Enum.SurfaceType.Smooth
  64. cap2.BottomSurface = Enum.SurfaceType.Smooth
  65. cap2.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  66. cap2.BrickColor = BrickColor.new("Really black")
  67. cap2.Friction = 0.30000001192093
  68. cap2.Shape = Enum.PartType.Cylinder
  69. cap2.Name = "Cap2"
  70. cap2.Parent = bow
  71. cap2.CanCollide = false
  72.  
  73. joint2 = Instance.new("Part")
  74. joint2.CFrame = CFrame.new(Vector3.new(-48.1999893, 2.19999003, -58.2000237)) * CFrame.Angles(1.5707963705063, 0, -0)
  75. joint2.TopSurface = Enum.SurfaceType.Smooth
  76. joint2.BottomSurface = Enum.SurfaceType.Smooth
  77. joint2.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  78. joint2.BrickColor = BrickColor.new("Really black")
  79. joint2.Friction = 0.30000001192093
  80. joint2.Shape = Enum.PartType.Cylinder
  81. joint2.Name = "Joint2"
  82. joint2.Parent = bow
  83. joint2.CanCollide = false
  84.  
  85. joint1 = Instance.new("Part")
  86. joint1.CFrame = CFrame.new(Vector3.new(-48.2000008, 3.39998126, -58.2000275)) * CFrame.Angles(1.5707963705063, 0, -0)
  87. joint1.TopSurface = Enum.SurfaceType.Smooth
  88. joint1.BottomSurface = Enum.SurfaceType.Smooth
  89. joint1.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  90. joint1.BrickColor = BrickColor.new("Really black")
  91. joint1.Friction = 0.30000001192093
  92. joint1.Shape = Enum.PartType.Cylinder
  93. joint1.Name = "Joint1"
  94. joint1.Parent = bow
  95. joint1.CanCollide = false
  96.  
  97. leg1 = Instance.new("Part")
  98. leg1.CFrame = CFrame.new(Vector3.new(-48.1999931, 4.35000753, -58.2000122)) * CFrame.Angles(-3.1415927410126, 0, -0)
  99. leg1.Size = Vector3.new(0.200000003, 1.90000021, 0.200000003)
  100. leg1.BrickColor = BrickColor.new("Really black")
  101. leg1.Friction = 0.30000001192093
  102. leg1.Shape = Enum.PartType.Block
  103. leg1.Name = "Leg1"
  104. leg1.Parent = bow
  105. leg1.CanCollide = false
  106.  
  107. cap1 = Instance.new("Part")
  108. cap1.CFrame = CFrame.new(Vector3.new(-48.2000046, 5.29999113, -58.2000122)) * CFrame.Angles(1.5707963705063, 0, -0)
  109. cap1.TopSurface = Enum.SurfaceType.Smooth
  110. cap1.BottomSurface = Enum.SurfaceType.Smooth
  111. cap1.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  112. cap1.BrickColor = BrickColor.new("Really black")
  113. cap1.Friction = 0.30000001192093
  114. cap1.Shape = Enum.PartType.Cylinder
  115. cap1.Name = "Cap1"
  116. cap1.Parent = bow
  117. cap1.CanCollide = false
  118.  
  119. stringpart = Instance.new("Part")
  120. stringpart.CFrame = CFrame.new(Vector3.new(-48.2000046, 5.29999113, -58.2000122)) * CFrame.Angles(1.5707963705063, 0, -0)
  121. stringpart.TopSurface = Enum.SurfaceType.Smooth
  122. stringpart.BottomSurface = Enum.SurfaceType.Smooth
  123. stringpart.Size = Vector3.new(0.1, 0.1, 0.1)
  124. stringpart.Transparency = 1
  125. stringpart.BrickColor = BrickColor.new("Really black")
  126. stringpart.Friction = 0.30000001192093
  127. stringpart.Shape = Enum.PartType.Cylinder
  128. stringpart.Name = "StringAttachment"
  129. stringpart.Parent = bow
  130. stringpart.CanCollide = false
  131.  
  132. arrow = Instance.new("Model")
  133. arrow.Parent = game.Workspace
  134. arrow.Name = "arrow"
  135.  
  136. feather1 = Instance.new("WedgePart")
  137. feather1.CFrame = CFrame.new(Vector3.new(-48.3000031, 2.90000844, -56.1500168)) * CFrame.Angles(-0, 0, -0)
  138. feather1.TopSurface = Enum.SurfaceType.Smooth
  139. feather1.Size = Vector3.new(0.200000003, 0.200000003, 0.299999952)
  140. feather1.BrickColor = BrickColor.new("Ghost grey")
  141. feather1.Friction = 0.30000001192093
  142. feather1.Name = "Feather"
  143. feather1.Parent = arrow
  144. feather1.CanCollide = false
  145. feather1.Transparency = 1
  146.  
  147. feather2 = Instance.new("WedgePart")
  148. feather2.CFrame = CFrame.new(Vector3.new(-48.3000031, 2.50003171, -56.1500168)) * CFrame.Angles(-0, 0, -3.1415927410126)
  149. feather2.TopSurface = Enum.SurfaceType.Smooth
  150. feather2.Size = Vector3.new(0.200000003, 0.200000003, 0.299999952)
  151. feather2.BrickColor = BrickColor.new("Ghost grey")
  152. feather2.Friction = 0.30000001192093
  153. feather2.Name = "Feather"
  154. feather2.Parent = arrow
  155. feather2.CanCollide = false
  156. feather2.Transparency = 1
  157.  
  158. arrowhead = Instance.new("WedgePart")
  159. arrowhead.CFrame = CFrame.new(Vector3.new(-48.2999992, 2.80002427, -59.4500008)) * CFrame.Angles(-0, 0, -0)
  160. arrowhead.TopSurface = Enum.SurfaceType.Smooth
  161. arrowhead.Size = Vector3.new(0.200000003, 0.200000003, 0.299999952)
  162. arrowhead.BrickColor = BrickColor.new("Gold")
  163. arrowhead.Friction = 0.30000001192093
  164. arrowhead.Name = "Arrowhead"
  165. arrowhead.Parent = arrow
  166. arrowhead.CanCollide = false
  167. arrowhead.Transparency = 1
  168.  
  169. arrowcap = Instance.new("Part")
  170. arrowcap.CFrame = CFrame.new(Vector3.new(-48.2000046, 5.29999113, -58.2000122)) * CFrame.Angles(1.5707963705063, 0, -0)
  171. arrowcap.TopSurface = Enum.SurfaceType.Smooth
  172. arrowcap.BottomSurface = Enum.SurfaceType.Smooth
  173. arrowcap.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  174. arrowcap.BrickColor = BrickColor.new("Ghost grey")
  175. arrowcap.Friction = 0.30000001192093
  176. arrowcap.Shape = Enum.PartType.Cylinder
  177. arrowcap.Name = "ArrowCap"
  178. arrowcap.Parent = arrow
  179. arrowcap.CanCollide = false
  180. arrowcap.Transparency = 1
  181.  
  182. arrowbody = Instance.new("Part")
  183. arrowbody.CFrame = CFrame.new(Vector3.new(0, 3, 0)) * CFrame.Angles(-0, 0, -0)
  184. arrowbody.Size = Vector3.new(0.200000003, 0.200000003, 3.60000014)
  185. arrowbody.BrickColor = BrickColor.new("Gold")
  186. arrowbody.Friction = 0.30000001192093
  187. arrowbody.Shape = Enum.PartType.Block
  188. arrowbody.Name = "ArrowBody"
  189. arrowbody.Parent = arrow
  190. arrowbody.CanCollide = false
  191. arrowbody.Transparency = 1
  192.  
  193. feather3 = Instance.new("WedgePart")
  194. feather3.CFrame = CFrame.new(Vector3.new(-48.3000031, 2.50004983, -55.9500198)) * CFrame.Angles(-0, 0, -3.1415927410126)
  195. feather3.TopSurface = Enum.SurfaceType.Smooth
  196. feather3.Size = Vector3.new(0.200000003, 0.200000003, 0.299999952)
  197. feather3.BrickColor = BrickColor.new("Ghost grey")
  198. feather3.Friction = 0.30000001192093
  199. feather3.Name = "Feather"
  200. feather3.Parent = arrow
  201. feather3.CanCollide = false
  202. feather3.Transparency = 1
  203.  
  204. feather4 = Instance.new("WedgePart")
  205. feather4.CFrame = CFrame.new(Vector3.new(-48.3000031, 2.90003037, -55.9500198)) * CFrame.Angles(-0, 0, -0)
  206. feather4.TopSurface = Enum.SurfaceType.Smooth
  207. feather4.Size = Vector3.new(0.200000003, 0.200000003, 0.299999952)
  208. feather4.BrickColor = BrickColor.new("Ghost grey")
  209. feather4.Friction = 0.30000001192093
  210. feather4.Name = "Feather"
  211. feather4.Parent = arrow
  212. feather4.CanCollide = false
  213. feather4.Transparency = 1
  214.  
  215. -- the welds
  216.  
  217. whandle = Instance.new("Weld", char["Left Arm"])
  218. whandle.Part0 = char.Torso
  219. whandle.Part1 = handle
  220. whandle.C0 = CFrame.new(0, 0, 0.6) * CFrame.Angles(0, 0, math.rad(45))
  221.  
  222. wstringpart = Instance.new("Weld", handle)
  223. wstringpart.Part0 = handle
  224. wstringpart.Part1 = stringpart
  225. wstringpart.C0 = CFrame.new(0, -0.3, -0.3) * CFrame.new(0, 0, 0)
  226.  
  227. wjoint1 = Instance.new("Weld", handle)
  228. wjoint1.Part0 = handle
  229. wjoint1.Part1 = joint1
  230. wjoint1.C0 = CFrame.new(0, 0.6, 0) * CFrame.Angles(-0.1, 0, 0)
  231.  
  232. wjoint2 = Instance.new("Weld", handle)
  233. wjoint2.Part0 = handle
  234. wjoint2.Part1 = joint2
  235. wjoint2.C0 = CFrame.new(0, -0.6, 0) * CFrame.Angles(0.1, 0, 0)
  236.  
  237. wleg1 = Instance.new("Weld", joint1)
  238. wleg1.Part0 = joint1
  239. wleg1.Part1 = leg1
  240. wleg1.C0 = CFrame.new(0, 0.95, 0) * CFrame.Angles(0, 0, 0)
  241.  
  242. wleg2 = Instance.new("Weld", joint2)
  243. wleg2.Part0 = joint2
  244. wleg2.Part1 = leg2
  245. wleg2.C0 = CFrame.new(0, -0.95, 0) * CFrame.Angles(0, 0, 0)
  246.  
  247. wcap1 = Instance.new("Weld", leg1)
  248. wcap1.Part0 = leg1
  249. wcap1.Part1 = cap1
  250. wcap1.C0 = CFrame.new(0, 0.95, 0) * CFrame.Angles(0, 0, 0)
  251.  
  252. wcap2 = Instance.new("Weld", leg2)
  253. wcap2.Part0 = leg2
  254. wcap2.Part1 = cap2
  255. wcap2.C0 = CFrame.new(0, -0.95, 0) * CFrame.Angles(0, 0, 0)
  256.  
  257. cap1att = Instance.new("Attachment", cap1)
  258. cap1att.Position = Vector3.new(0, 0, -0.05)
  259. cap2att = Instance.new("Attachment", cap2)
  260. cap2att.Position = Vector3.new(0, 0, -0.05)
  261. stringatt = Instance.new("Attachment", stringpart)
  262. stringp1 = Instance.new("RodConstraint", stringpart)
  263. stringp1.Color = BrickColor.new("Mid grey")
  264. stringp1.Visible = true
  265. stringp1.Attachment0 = stringatt
  266. stringp1.Attachment1 = cap1att
  267. stringp2 = Instance.new("RodConstraint", stringpart)
  268. stringp2.Color = BrickColor.new("Mid grey")
  269. stringp2.Visible = true
  270. stringp2.Attachment0 = stringatt
  271. stringp2.Attachment1 = cap2att
  272.  
  273. warrowhead1 = Instance.new("Weld", arrowbody)
  274. warrowhead1.Part0 = arrowbody
  275. warrowhead1.Part1 = arrowhead
  276. warrowhead1.C0 = CFrame.new(0, 0, -1.95)
  277.  
  278. wfeather1 = Instance.new("Weld", arrowbody)
  279. wfeather1.Part0 = arrowbody
  280. wfeather1.Part1 = feather1
  281. wfeather1.C0 = CFrame.new(0, 0.2, 1.45)
  282.  
  283. wfeather2 = Instance.new("Weld", arrowbody)
  284. wfeather2.Part0 = arrowbody
  285. wfeather2.Part1 = feather2
  286. wfeather2.C0 = CFrame.new(0, 0.2, 1.4)
  287.  
  288. wfeather3 = Instance.new("Weld", arrowbody)
  289. wfeather3.Part0 = arrowbody
  290. wfeather3.Part1 = feather3
  291. wfeather3.C0 = CFrame.new(0, -0.2, 1.45) * CFrame.Angles(0, 0, 3.15)
  292.  
  293. wfeather4 = Instance.new("Weld", arrowbody)
  294. wfeather4.Part0 = arrowbody
  295. wfeather4.Part1 = feather4
  296. wfeather4.C0 = CFrame.new(0, -0.2, 1.4) * CFrame.Angles(0, 0, 3.15)
  297.  
  298. warrow = Instance.new("Weld", char.Torso)
  299. warrow.Part0 = char.Torso
  300. warrow.Part1 = arrowbody
  301. warrow.C0 = CFrame.new(0, 0, 0.5) * CFrame.Angles(-1.575, 0, 1.575)
  302.  
  303. warrowcap = Instance.new("Weld", arrowbody)
  304. warrowcap.Part0 = arrowbody
  305. warrowcap.Part1 = arrowcap
  306. warrowcap.C0 = CFrame.new(0, 0, 1.8)
  307.  
  308. -- sounds
  309.  
  310. pullbacksound = Instance.new("Sound", handle)
  311. pullbacksound.SoundId = "rbxassetid://609348868"
  312.  
  313. firesound = Instance.new("Sound", handle)
  314. firesound.SoundId = "rbxassetid://609348009"
  315. firesound.PlaybackSpeed = 1.05
  316.  
  317. function velocity(v)
  318. print("killvel")
  319. vel = coroutine.wrap(function()
  320. wait(0.05)
  321. v:Remove()
  322. end)
  323. vel()
  324. end
  325.  
  326. function killz(playa,hitz,kneef)
  327. local heyy = hitz
  328. if hitz == "Right Arm" then
  329. local Limb = playa:FindFirstChild("Right Arm")
  330. local ters = playa:FindFirstChild('Torso')
  331. if Limb and ters then
  332. if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end
  333. for i,v in pairs(Limb:GetChildren()) do
  334. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  335. v:Destroy()
  336. end
  337. end
  338. Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0)
  339. local Joint = Instance.new("Glue")
  340. Joint.Name = "RightShoulder"
  341. Joint.Part0 = ters
  342. Joint.Part1 = Limb
  343. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  344. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  345. Joint.Parent = ters
  346.  
  347. local B = Instance.new("Part")
  348. B.TopSurface = 0
  349. B.BottomSurface = 0
  350. B.formFactor = "Symmetric"
  351. B.Size = Vector3.new(1, 1, 1)
  352. B.Transparency = 1
  353. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  354. B.Parent = playa
  355. local W = Instance.new("Weld")
  356. W.Part0 = Limb
  357. W.Part1 = B
  358. W.C0 = CFrame.new(0, -0.5, 0)
  359. W.Parent = Limb
  360. local coru = coroutine.wrap(function()
  361. local uno = Instance.new('Part',workspace)
  362. local dos = Instance.new('Part',workspace)
  363. uno.CFrame = playa:FindFirstChild(hitz).CFrame
  364. dos.CFrame = kneef.CFrame
  365. local weld = Instance.new('Weld',kneef)
  366. weld.Part0 = playa:FindFirstChild(hitz)
  367. weld.Part1 = kneef
  368. weld.C0 = uno.CFrame:toObjectSpace(dos.CFrame)
  369. uno:Destroy()
  370. dos:Destroy()
  371. end)
  372. coru()
  373. end
  374. elseif hitz == "Left Arm" then
  375. local Limb = playa:FindFirstChild("Left Arm")
  376. local ters = playa:FindFirstChild('Torso')
  377. if Limb and ters then
  378. if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end
  379. for i,v in pairs(Limb:GetChildren()) do
  380. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  381. v:Destroy()
  382. end
  383. end
  384. Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0)
  385. local Joint = Instance.new("Glue")
  386. Joint.Name = "LeftShoulder"
  387. Joint.Part0 = ters
  388. Joint.Part1 = Limb
  389. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  390. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  391. Joint.Parent = ters
  392.  
  393. local B = Instance.new("Part")
  394. B.TopSurface = 0
  395. B.BottomSurface = 0
  396. B.formFactor = "Symmetric"
  397. B.Size = Vector3.new(1, 1, 1)
  398. B.Transparency = 1
  399. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  400. B.Parent = playa
  401. local W = Instance.new("Weld")
  402. W.Part0 = ters
  403. W.Part1 = B
  404. W.C0 = CFrame.new(0, -0.5, 0)
  405. W.Parent = Limb
  406. local coru = coroutine.wrap(function()
  407. local uno = Instance.new('Part',workspace)
  408. local dos = Instance.new('Part',workspace)
  409. uno.CFrame = playa:FindFirstChild(hitz).CFrame
  410. dos.CFrame = kneef.CFrame
  411. local weld = Instance.new('Weld',kneef)
  412. weld.Part0 = playa:FindFirstChild(hitz)
  413. weld.Part1 = kneef
  414. weld.C0 = uno.CFrame:toObjectSpace(dos.CFrame)
  415. uno:Destroy()
  416. dos:Destroy()
  417. end)
  418. coru()
  419. end
  420. elseif hitz == "Right Leg" then
  421. local Limb = playa:FindFirstChild("Right Leg")
  422. local ters = playa:FindFirstChild('Torso')
  423. if Limb and ters then
  424. if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end
  425. for i,v in pairs(Limb:GetChildren()) do
  426. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  427. v:Destroy()
  428. end
  429. end
  430. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  431. local Joint = Instance.new("Glue")
  432. Joint.Name = "Right Hip"
  433. Joint.Part0 = ters
  434. Joint.Part1 = Limb
  435. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  436. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  437. Joint.Parent = ters
  438. local B = Instance.new("Part")
  439. B.TopSurface = 0
  440. B.BottomSurface = 0
  441. B.formFactor = "Symmetric"
  442. B.Size = Vector3.new(1, 1, 1)
  443. B.Transparency = 1
  444. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  445. B.Parent = playa
  446. local W = Instance.new("Weld")
  447. W.Part0 = Limb
  448. W.Part1 = B
  449. W.C0 = CFrame.new(0, -0.5, 0)
  450. W.Parent = Limb
  451. local coru = coroutine.wrap(function()
  452. local uno = Instance.new('Part',workspace)
  453. local dos = Instance.new('Part',workspace)
  454. uno.CFrame = playa:FindFirstChild(hitz).CFrame
  455. dos.CFrame = kneef.CFrame
  456. local weld = Instance.new('Weld',kneef)
  457. weld.Part0 = playa:FindFirstChild(hitz)
  458. weld.Part1 = kneef
  459. weld.C0 = uno.CFrame:toObjectSpace(dos.CFrame)
  460. uno:Destroy()
  461. dos:Destroy()
  462. if playa:FindFirstChild('HumanoidRootPart') then
  463. if playa.HumanoidRootPart:FindFirstChild('RootJoint') then
  464. playa.HumanoidRootPart:FindFirstChild('RootJoint'):Destroy()
  465. wait()
  466. end
  467. while playa.HumanoidRootPart:FindFirstChild('RootJoint') do
  468. wait()
  469. end
  470. playa:FindFirstChild('HumanoidRootPart'):Destroy()
  471. end
  472. end)
  473. coru()
  474. end
  475. elseif hitz == "Left Leg" then
  476. local Limb = playa:FindFirstChild("Left Leg")
  477. local ters = playa:FindFirstChild('Torso')
  478. if Limb and ters then
  479. if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end
  480. for i,v in pairs(Limb:GetChildren()) do
  481. if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then
  482. v:Destroy()
  483. end
  484. end
  485. Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0)
  486. Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0)
  487. local Joint = Instance.new("Glue")
  488. Joint.Name = "LeftHip"
  489. Joint.Part0 = ters
  490. Joint.Part1 = Limb
  491. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  492. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  493. Joint.Parent = ters
  494.  
  495. local B = Instance.new("Part")
  496. B.TopSurface = 0
  497. B.BottomSurface = 0
  498. B.formFactor = "Symmetric"
  499. B.Size = Vector3.new(1, 1, 1)
  500. B.Transparency = 1
  501. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  502. B.Parent = playa
  503. local W = Instance.new("Weld")
  504. W.Part0 = Limb
  505. W.Part1 = B
  506. W.C0 = CFrame.new(0, -0.5, 0)
  507. W.Parent = Limb
  508. Limb.CanCollide = false
  509. local coru = coroutine.wrap(function()
  510. local uno = Instance.new('Part',workspace)
  511. local dos = Instance.new('Part',workspace)
  512. uno.CFrame = playa:FindFirstChild(hitz).CFrame
  513. dos.CFrame = kneef.CFrame
  514. local weld = Instance.new('Weld',kneef)
  515. weld.Part0 = playa:FindFirstChild(hitz)
  516. weld.Part1 = kneef
  517. weld.C0 = uno.CFrame:toObjectSpace(dos.CFrame)
  518. uno:Destroy()
  519. dos:Destroy()
  520. if playa:FindFirstChild('HumanoidRootPart') then
  521. if playa.HumanoidRootPart:FindFirstChild('RootJoint') then
  522. playa.HumanoidRootPart:FindFirstChild('RootJoint'):Destroy()
  523. end
  524. while playa.HumanoidRootPart:FindFirstChild('RootJoint') do
  525. wait()
  526. end
  527. playa:FindFirstChild('HumanoidRootPart'):Destroy()
  528. end
  529. end)
  530. coru()
  531. end
  532. else
  533. local playa2 = playa
  534. playa.Archivable = true
  535. local playa = playa:Clone()
  536. playa.Archivable = false
  537. playa2:Destroy()
  538. playa.Parent = workspace
  539. local Gibs = game.Workspace
  540. local Torso = playa.Torso
  541. local Head = playa:FindFirstChild("Head")
  542. local function Scan(ch)
  543. local e
  544. for e = 1,#ch do
  545. Scan(ch[e]:GetChildren())
  546. if (ch[e].ClassName == "Weld" and ch[e].Part1.Name ~= 'Projectile') or ch[e].ClassName == "Motor6D" then
  547. ch[e]:remove()
  548. end
  549. end
  550. end
  551. Scan(playa:GetChildren())
  552. if playa:FindFirstChild('HumanoidRootPart') then
  553. playa:FindFirstChild('HumanoidRootPart'):Destroy()
  554. end
  555. local hum2 = playa:FindFirstChildOfClass("Humanoid")
  556.  
  557.  
  558. if hum2 ~= nil then
  559. hum2.Name = "Humanoid2"
  560. hum2.PlatformStand = true
  561. hum2.Health = 0
  562. end
  563. local ch = playa:GetChildren()
  564. local i
  565. for i = 1,#ch do
  566. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  567. ch[i]:remove()
  568. end
  569. end
  570.  
  571. if Head then
  572. local Neck = Instance.new("Weld")
  573. Neck.Name = "Neck"
  574. Neck.Part0 = Torso
  575. Neck.Part1 = Head
  576. Neck.C0 = CFrame.new(0, 1.5, 0)
  577. Neck.C1 = CFrame.new()
  578. Neck.Parent = Torso
  579. end
  580. local Limb = playa:FindFirstChild("Right Arm")
  581. if Limb then
  582.  
  583. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  584. local Joint = Instance.new("Glue")
  585. Joint.Name = "RightShoulder"
  586. Joint.Part0 = Torso
  587. Joint.Part1 = Limb
  588. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  589. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  590. Joint.Parent = Torso
  591.  
  592. local B = Instance.new("Part")
  593. B.TopSurface = 0
  594. B.BottomSurface = 0
  595. B.formFactor = "Symmetric"
  596. B.Size = Vector3.new(1, 1, 1)
  597. B.Transparency = 1
  598. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  599. B.Parent = playa
  600. local W = Instance.new("Weld")
  601. W.Part0 = Limb
  602. W.Part1 = B
  603. W.C0 = CFrame.new(0, -0.5, 0)
  604. W.Parent = Limb
  605. end
  606. local Limb = playa:FindFirstChild("Left Arm")
  607. if Limb then
  608.  
  609. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  610. local Joint = Instance.new("Glue")
  611. Joint.Name = "LeftShoulder"
  612. Joint.Part0 = Torso
  613. Joint.Part1 = Limb
  614. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  615. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  616. Joint.Parent = Torso
  617.  
  618. local B = Instance.new("Part")
  619. B.TopSurface = 0
  620. B.BottomSurface = 0
  621. B.formFactor = "Symmetric"
  622. B.Size = Vector3.new(1, 1, 1)
  623. B.Transparency = 1
  624. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  625. B.Parent = playa
  626. local W = Instance.new("Weld")
  627. W.Part0 = Limb
  628. W.Part1 = B
  629. W.C0 = CFrame.new(0, -0.5, 0)
  630. W.Parent = Limb
  631. end
  632. local Limb = playa:FindFirstChild("Right Leg")
  633. if Limb then
  634.  
  635. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  636. local Joint = Instance.new("Glue")
  637. Joint.Name = "RightHip"
  638. Joint.Part0 = Torso
  639. Joint.Part1 = Limb
  640. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  641. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  642. Joint.Parent = Torso
  643.  
  644. local B = Instance.new("Part")
  645. B.TopSurface = 0
  646. B.BottomSurface = 0
  647. B.formFactor = "Symmetric"
  648. B.Size = Vector3.new(1, 1, 1)
  649. B.Transparency = 1
  650. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  651. B.Parent = playa
  652. local W = Instance.new("Weld")
  653. W.Part0 = Limb
  654. W.Part1 = B
  655. W.C0 = CFrame.new(0, -0.5, 0)
  656. W.Parent = Limb
  657. end
  658. local Limb = playa:FindFirstChild("Left Leg")
  659. if Limb then
  660.  
  661. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  662. local Joint = Instance.new("Glue")
  663. Joint.Name = "LeftHip"
  664. Joint.Part0 = Torso
  665. Joint.Part1 = Limb
  666. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  667. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  668. Joint.Parent = Torso
  669.  
  670. local B = Instance.new("Part")
  671. B.TopSurface = 0
  672. B.BottomSurface = 0
  673. B.formFactor = "Symmetric"
  674. B.Size = Vector3.new(1, 1, 1)
  675. B.Transparency = 1
  676. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  677. B.Parent = playa
  678. local W = Instance.new("Weld")
  679. W.Part0 = Limb
  680. W.Part1 = B
  681. W.C0 = CFrame.new(0, -0.5, 0)
  682. W.Parent = Limb
  683. end
  684. --[
  685. local Bar = Instance.new("Part")
  686. Bar.TopSurface = 0
  687. Bar.BottomSurface = 0
  688. Bar.formFactor = "Symmetric"
  689. Bar.Size = Vector3.new(1, 1, 1)
  690. Bar.Transparency = 1
  691. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  692. Bar.Parent = playa
  693. local Weld = Instance.new("Weld")
  694. Weld.Part0 = Torso
  695. Weld.Part1 = Bar
  696. Weld.C0 = CFrame.new(0, 0.5, 0)
  697. Weld.Parent = Torso
  698. --]]
  699. playa.Parent = Gibs
  700. local coru = coroutine.wrap(function()
  701. print(hitz.Name)
  702. local uno = Instance.new('Part',workspace)
  703. local dos = Instance.new('Part',workspace)
  704. uno.CFrame = playa:FindFirstChild(heyy).CFrame
  705. dos.CFrame = kneef.CFrame
  706. local weld = Instance.new('Weld',kneef)
  707. weld.Part0 = playa:FindFirstChild(heyy)
  708. weld.Part1 = kneef
  709. weld.C0 = uno.CFrame:toObjectSpace(dos.CFrame)
  710. uno:Destroy()
  711. dos:Destroy()
  712. end)
  713. coru()
  714. game.Debris:AddItem(playa, 15)
  715. end
  716. end
  717.  
  718. function checkarms()
  719. check = coroutine.wrap(function()
  720. rshould = char.Torso:FindFirstChild("Right Shoulder")
  721. lshould = char.Torso:FindFirstChild("Left Shoulder")
  722.  
  723. if rshould == nil then
  724. rightshoulder:Clone().Parent = char.Torso
  725. end
  726. if lshould == nil then
  727. rightshoulder:Clone().Parent = char.Torso
  728. end
  729. end)
  730. check()
  731. end
  732.  
  733. mouse.KeyDown:connect(function(k)
  734. key = k:lower()
  735.  
  736. if key == "e" and enabled == true and equipped == true then
  737. if armed == false then
  738. crarm = Instance.new("Weld", char.Torso)
  739. crarm.Part0 = char.Torso
  740. crarm.Part1 = char["Right Arm"]
  741. crarm.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(1.5, 0, 0)
  742.  
  743. clarm = Instance.new("Weld", char.Torso)
  744. clarm.Part0 = char.Torso
  745. clarm.Part1 = char["Left Arm"]
  746. clarm.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(-1.5, 0, 0)
  747.  
  748. enabled = false
  749. for i = 0, 1, 0.1 do
  750. crarm.C0 = crarm.C0:lerp(CFrame.new(1.5, 1.5, 0) * CFrame.Angles(3.14, 0, 0), i)
  751. wait()
  752. end
  753. for i, v in pairs(arrow:GetChildren()) do
  754. v.Transparency = 0
  755. end
  756. feather1.Transparency = 0.25
  757. feather2.Transparency = 0.25
  758. feather3.Transparency = 0.25
  759. feather4.Transparency = 0.25
  760.  
  761. warrow.Part0 = char["Right Arm"]
  762. warrow.C0 = CFrame.new(-0.5, -2.7, -0.2) * CFrame.Angles(-1.575, 0.075, -0.5)
  763.  
  764. for i = 0, 1, 0.05 do
  765. tors.C0 = tors.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, -1.5, 0), i)
  766. whandle.C0 = whandle.C0:lerp(CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, -0.05, 0), i)
  767. clarm.C0 = clarm.C0:lerp(CFrame.new(-1.6, 0.45, -0.10) * CFrame.Angles(1.2, 0, -1.575), i)
  768. crarm.C0 = crarm.C0:lerp(CFrame.new(-1.35, 0.6, -1) * CFrame.Angles(1.575, 0, -1.575), i)
  769. wjoint1.C0 = wjoint1.C0:lerp(CFrame.new(0, 0.6, 0) * CFrame.Angles(-0.1, 0, 0), i)
  770. wjoint2.C0 = wjoint2.C0:lerp(CFrame.new(0, -0.6, 0) * CFrame.Angles(0.1, 0, 0), i)
  771. wstringpart.C0 = wstringpart.C0:lerp(CFrame.new(0, -0.5, -0.3) * CFrame.new(0, 0, 0), i)
  772. hed.C0 = hed.C0:lerp(CFrame.new(0, 1.55, 0) * CFrame.Angles(0, 1.5, 0), i)
  773. wait()
  774. end
  775. pullbacksound:Play()
  776. warrow.Part0 = stringpart
  777. warrow.C0 = CFrame.new(-0.1, 0, 1.9) * CFrame.Angles(3.15, 0.04, 0)
  778. for i = 0, 1, 0.025 do
  779. tors.C0 = tors.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, -1.5, 0), i)
  780. whandle.C0 = whandle.C0:lerp(CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, -0.05, 0), i)
  781. clarm.C0 = clarm.C0:lerp(CFrame.new(-1.95, 0.45, -0.10) * CFrame.Angles(1.2, 0, -1.575), i)
  782. crarm.C0 = crarm.C0:lerp(CFrame.new(1, 0.6, -1) * CFrame.Angles(1.575, 0, -1.575), i)
  783. wjoint1.C0 = wjoint1.C0:lerp(CFrame.new(0, 0.6, 0) * CFrame.Angles(-0.4, 0, 0), i)
  784. wjoint2.C0 = wjoint2.C0:lerp(CFrame.new(0, -0.6, 0) * CFrame.Angles(0.4, 0, 0), i)
  785. wstringpart.C0 = wstringpart.C0:lerp(CFrame.new(0, -0.5, -3) * CFrame.new(0, 0, 0), i)
  786. hed.C0 = hed.C0:lerp(CFrame.new(0, 1.55, -0.1) * CFrame.Angles(0, 1.5, -0.25), i)
  787. wait()
  788. end
  789. armed = true
  790. enabled = true
  791. elseif armed == true and equipped == true then
  792. enabled = false
  793. for i = 0,1,0.05 do
  794. clarm.C0 = clarm.C0:lerp(CFrame.new(-1.6, 0.45, -0.10) * CFrame.Angles(1.2, 0, -1.575), i)
  795. crarm.C0 = crarm.C0:lerp(CFrame.new(-1.3, 0.4, -1) * CFrame.Angles(1.575, 0.1, -1.575), i)
  796. wjoint1.C0 = wjoint1.C0:lerp(CFrame.new(0, 0.6, 0) * CFrame.Angles(-0.1, 0, 0), i)
  797. wjoint2.C0 = wjoint2.C0:lerp(CFrame.new(0, -0.6, 0) * CFrame.Angles(0.1, 0, 0), i)
  798. wstringpart.C0 = wstringpart.C0:lerp(CFrame.new(0, -0.5, -0.3) * CFrame.new(0, 0, 0), i)
  799. wait()
  800. end
  801. warrow.Part0 = char["Right Arm"]
  802. warrow.C0 = CFrame.new(-0.5, -2.65, -0.2) * CFrame.Angles(-1.575, 0.075, -0.4)
  803. for i = 0,1,0.05 do
  804. crarm.C0 = crarm.C0:lerp(CFrame.new(1.5, 1.5, 0) * CFrame.Angles(3.14, 0, 0), i)
  805. tors.C0 = tors.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), i)
  806. whandle.C0 = whandle.C0:lerp(CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, 0, 0), i)
  807. clarm.C0 = clarm.C0:lerp(CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, 0), i)
  808. crarm.C0 = crarm.C0:lerp(CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, 0), i)
  809. hed.C0 = hed.C0:lerp(CFrame.new(0, 1.55, 0) * CFrame.Angles(0, 0, 0), i)
  810. wait()
  811. end
  812.  
  813. for i, v in pairs(arrow:GetChildren()) do
  814. v.Transparency = 1
  815. end
  816. warrow.Part0 = char.Torso
  817. warrow.C0 = CFrame.new(0, 0, 0.5) * CFrame.Angles(-1.575, 0, 1.575)
  818.  
  819. for i = 0, 1, 0.1 do
  820. crarm.C0 = crarm.C0:lerp(CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, 0), i)
  821. wait()
  822. end
  823. armed = false
  824. enabled = true
  825. clarm:Remove()
  826. crarm:Remove()
  827. rightshoulder:Clone().Parent = char.Torso
  828. leftshoulder:Clone().Parent = char.Torso
  829. checkarms()
  830. end
  831. elseif key == "z" then
  832. if armed == true or enabled == false then return end
  833. clarm = Instance.new("Weld", char.Torso)
  834. clarm.Part0 = char.Torso
  835. clarm.Part1 = char["Left Arm"]
  836. clarm.C0 = CFrame.Angles(0, 0, 0) * CFrame.new(-1.5, 0, 0)
  837. if equipped == false then
  838. enabled = false
  839. for i = 0, 1, 0.05 do
  840. clarm.C0 = clarm.C0:lerp(CFrame.new(-0.5, 0, 0.25) * CFrame.Angles(math.rad(-90), 0, math.rad(75)), i)
  841. wait()
  842. end
  843. whandle.C0 = CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, 0, 0)
  844. whandle.Part0 = char["Left Arm"]
  845. for i = 0, 1, 0.05 do
  846. clarm.C0 = clarm.C0:lerp(CFrame.new(-2, 0.6, 0) * CFrame.Angles(0, 0, math.rad(-90)), i)
  847. wait()
  848. end
  849. for i = 0, 1, 0.05 do
  850. clarm.C0 = clarm.C0:lerp(CFrame.Angles(0, 0, 0) * CFrame.new(-1.5, 0, 0), i)
  851. wait()
  852. end
  853. enabled = true
  854. equipped = true
  855. elseif equipped == true then
  856. if armed == true or enabled == false then return end
  857. enabled = false
  858. for i = 0, 1, 0.05 do
  859. clarm.C0 = clarm.C0:lerp(CFrame.new(-2, 0.6, 0) * CFrame.Angles(0, 0, math.rad(-90)), i)
  860. wait()
  861. end
  862. for i = 0, 1, 0.05 do
  863. clarm.C0 = clarm.C0:lerp(CFrame.new(-0.5, 0, 0.25) * CFrame.Angles(math.rad(-90), 0, math.rad(75)), i)
  864. whandle.C0 = whandle.C0:lerp(CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, 0, 0), i)
  865. wait()
  866. end
  867. whandle.C0 = CFrame.new(0, 0, 0.6) * CFrame.Angles(0, 0, math.rad(45))
  868. whandle.Part0 = char.Torso
  869. for i = 0, 1, 0.05 do
  870. clarm.C0 = clarm.C0:lerp(CFrame.Angles(0, 0, 0) * CFrame.new(-1.5, 0, 0), i)
  871. wait()
  872. end
  873. equipped = false
  874. enabled = true
  875. end
  876. clarm:Remove()
  877. leftshoulder:Clone().Parent = char.Torso
  878. end
  879. end)
  880.  
  881. mouse.Button1Down:connect(function()
  882. if armed == false or enabled == false or equipped == false then return end
  883. firesound:Play()
  884. enabled = false
  885. armed = false
  886. wjoint1.C0 = CFrame.new(0, 0.6, 0) * CFrame.Angles(-0.1, 0, 0)
  887. wjoint2.C0 = CFrame.new(0, -0.6, 0) * CFrame.Angles(0.1, 0, 0)
  888. wstringpart.C0 = CFrame.new(0, -0.5, -0.3) * CFrame.new(0, 0, 0)
  889. crarm.C0 = CFrame.new(1.2, 0.6, -1) * CFrame.Angles(1.575, 0, -1.575)
  890. newarrow = arrow:Clone()
  891. newarrow.Parent = game.Workspace
  892. newarrow.Name = "flyingarrow"
  893. newarrow.ArrowBody.CFrame = CFrame.new(newarrow.ArrowBody.CFrame.p, mouse.Hit.p)*CFrame.Angles(0,0,math.pi/1.15)
  894. char.HumanoidRootPart.CFrame = CFrame.new(char.HumanoidRootPart.CFrame.p, mouse.Hit.p)*CFrame.Angles(0,math.pi/100,0)
  895. char.Humanoid.JumpPower = 1
  896. char.Humanoid.Jump = true
  897. local fly = Instance.new('BodyVelocity',newarrow.ArrowBody)
  898. fly.Velocity = (newarrow.ArrowBody.CFrame*CFrame.Angles(0,0,math.pi/2)).lookVector*200
  899. newarrow.Arrowhead.Touched:connect(function(hit)
  900. if hit.Parent and hit.Parent:FindFirstChildOfClass('Humanoid') and hit.Transparency < 1 and newarrow.Arrowhead.CanCollide == false and hit.Parent:FindFirstChildOfClass('Humanoid').Health > 0 and hit.Parent ~= char then
  901. velocity(fly)
  902. newarrow.Arrowhead.CanCollide = true
  903. game:GetService('Debris'):AddItem(newarrow.Arrowhead,15)
  904. tone = math.random(1, 3)
  905. local sound = Instance.new('Sound',newarrow.Arrowhead)
  906. if tone == 1 then sound.SoundId = "rbxassetid://220833967" end
  907. if tone == 2 then sound.SoundId = "rbxassetid://220833976" end
  908. if tone == 3 then sound.SoundId = "rbxassetid://220834000" end
  909. sound.PlaybackSpeed = 1
  910. sound:Play()
  911. newarrow.Arrowhead.Anchored = true
  912. hit.Anchored = true
  913. if hit.Parent:FindFirstChildOfClass('Humanoid') and hit.Name == "Torso" or hit.Name == "Head" then
  914. hit.Parent:FindFirstChildOfClass('Humanoid').Health = 0
  915. end
  916. wait()
  917. hit.Anchored = false
  918. newarrow.Arrowhead.Anchored = false
  919. killz(hit.Parent,hit.Name,newarrow.Arrowhead)
  920. elseif hit.Parent and hit.Parent.Parent:FindFirstChildOfClass('Humanoid') and hit.Transparency < 1 and newarrow.Arrowhead.CanCollide == false and hit.Parent.Parent:FindFirstChildOfClass('Humanoid').Health > 0 and hit.Parent.Parent ~= char and hit.Parent.Parent:FindFirstChild('Head') then
  921. velocity(fly)
  922. game:GetService('Debris'):AddItem(newarrow.Arrowhead,15)
  923. newarrow.Arrowhead.CanCollide = true
  924. tone = math.random(1, 3)
  925. local sound = Instance.new('Sound',newarrow.Arrowhead)
  926. if tone == 1 then sound.SoundId = "rbxassetid://220833967" end
  927. if tone == 2 then sound.SoundId = "rbxassetid://220833976" end
  928. if tone == 3 then sound.SoundId = "rbxassetid://220834000" end
  929. sound.PlaybackSpeed = 1
  930. sound:Play()
  931. newarrow.Arrowhead.Anchored = true
  932. hit.Anchored = true
  933. if hit.Parent.Parent:FindFirstChildOfClass('Humanoid') then
  934. hit.Parent.Parent:FindFirstChildOfClass('Humanoid').Health = 0
  935. end
  936. wait()
  937. newarrow.Arrowhead.Anchored = false
  938. hit.Anchored = false
  939. killz(hit.Parent.Parent,hit.Name,newarrow.Arrowhead)
  940. elseif hit.Parent and hit.Parent ~= char and hit.Parent.Parent ~= char and hit.Transparency < 1 and newarrow.Arrowhead.CanCollide == false then
  941. velocity(fly)
  942. game:GetService('Debris'):AddItem(newarrow.Arrowhead,15)
  943. newarrow.Arrowhead.CanCollide = true
  944. local sound = Instance.new('Sound',newarrow.Arrowhead)
  945. sound.SoundId = 'rbxassetid://267585646'
  946. sound:Play()
  947. end
  948. end)
  949.  
  950. for i, v in pairs(arrow:GetChildren()) do
  951. v.Transparency = 1
  952. end
  953. warrow.Part0 = char.Torso
  954. warrow.C0 = CFrame.new(0, 0, 0.5) * CFrame.Angles(-1.575, 0, 1.575)
  955. wait(0.5)
  956. for i = 0, 1, 0.05 do
  957. tors.C0 = tors.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0), i)
  958. whandle.C0 = whandle.C0:lerp(CFrame.new(0.4, -1, 0) * CFrame.Angles(1.575, 0, 0), i)
  959. clarm.C0 = clarm.C0:lerp(CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, 0), i)
  960. crarm.C0 = crarm.C0:lerp(CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, 0), i)
  961. hed.C0 = hed.C0:lerp(CFrame.new(0, 1.55, 0) * CFrame.Angles(0, 0, 0), i)
  962. wait()
  963. end
  964. clarm:Remove()
  965. crarm:Remove()
  966. rightshoulder:Clone().Parent = char.Torso
  967. leftshoulder:Clone().Parent = char.Torso
  968. checkarms()
  969. char.Humanoid.JumpPower = 50
  970. enabled = true
  971. end)
  972.  
  973.  
  974. local player = game:service("Players").LocalPlayer
  975. local mouse = player:GetMouse()
  976. local cam = workspace.CurrentCamera
  977. local char = player.Character
  978. local Torsoz = char:findFirstChild("Torso")
  979. local RA = char:findFirstChild("Right Arm")
  980. local LA = char:findFirstChild("Left Arm")
  981. local RL = char:findFirstChild("Right Leg")
  982. local LL = char:findFirstChild("Left Leg")
  983. local H = char:findFirstChild("Head")
  984. local Hu = char:findFirstChild("Humanoid")
  985. local RS = Torsoz:findFirstChild("Right Shoulder")
  986. local LS = Torsoz:findFirstChild("Left Shoulder")
  987. local RH = Torsoz:findFirstChild("Right Hip")
  988. local LH = Torsoz:findFirstChild("Left Hip")
  989. local N = Torsoz:findFirstChild("Neck")
  990. local NV = Vector3.new(0,0,0)
  991. local FOV = 70
  992. local Shift, Space, Sitting = false,false,false
  993. local GravPoint = 0
  994. local Diving = false
  995. local DivingCooldown = 0
  996. local DivingDir = NV
  997. local DivingCF = CFrame.new(0,0,0)
  998. local DivingBG, DivingBV
  999. local HWallRunning = false
  1000. local HWRGravDrop = false
  1001. local HWRLastPart
  1002. local HWRCooldown = 0
  1003. local HWRDir
  1004. local VWallRunning = false
  1005. local VWRLastPart
  1006. local VWRCooldown = 0
  1007. local VWRLeft,VWRRight = false,false
  1008. local Sliding = false
  1009. local SlideCooldown = 0
  1010. local Standing = true
  1011. local Action = "Standing"
  1012. local animplus = true
  1013. local animspeed = 0
  1014. local animangle = 0.01
  1015. local Joint1, Joint2, Joint3, Joint4, Joint5
  1016.  
  1017. for i, v in pairs(char:children()) do
  1018. if (v.className == "LocalScript" and v.Name == "ParkourSkrip") or v.className == "NumberValue" or v.className == "BoolValue" or v.className == "Model" or v.Name == "Animate" then
  1019. v:remove()
  1020. end
  1021. end
  1022.  
  1023. local loadids = {112474909, 112474911, 112474909}
  1024.  
  1025. local stamina = 10000
  1026. local maxstamina = 10000
  1027. local defsprint = 28
  1028. local sprint = defsprint
  1029.  
  1030. local pause = Instance.new("BoolValue", char)
  1031. pause.Name = "Pause"
  1032. pause.Value = false
  1033. local flow = Instance.new("NumberValue", char)
  1034. flow.Name = "Flow"
  1035. flow.Value = 0
  1036. local flowcooldown = 0
  1037.  
  1038. local m = Instance.new("Model", char)
  1039. m.Name = "FlowChainPartz"
  1040.  
  1041. local P = Instance.new("Part")
  1042. P.Name = "TrailPart"
  1043. P.formFactor = "Custom"
  1044. P.Size = Vector3.new(0.2,0.2,0.2)
  1045. P.Locked = true
  1046. P.Anchored = true
  1047. P.CanCollide = false
  1048. P.TopSurface = 0
  1049. P.BottomSurface = 0
  1050.  
  1051. script.Name = "ParkourSkrip"
  1052.  
  1053. local hue = 0
  1054.  
  1055. function HSV(H,S,V)
  1056. H = H % 360
  1057. local C = V * S
  1058. local H2 = H/60
  1059. local X = C * (1 - math.abs((H2 %2) -1))
  1060. local color = Color3.new(0,0,0)
  1061. if H2 <= 0 then
  1062. color = Color3.new(C,0,0)
  1063. elseif 0 <= H2 and H2 <= 1 then
  1064. color = Color3.new(C,X,0)
  1065. elseif 1 <= H2 and H2 <= 2 then
  1066. color = Color3.new(X,C,0)
  1067. elseif 2 <= H2 and H2 <= 3 then
  1068. color = Color3.new(0,C,X)
  1069. elseif 3 <= H2 and H2 <= 4 then
  1070. color = Color3.new(0,X,C)
  1071. elseif 4 <= H2 and H2 <= 5 then
  1072. color = Color3.new(X,0,C)
  1073. elseif 5 <= H2 and H2 <= 6 then
  1074. color = Color3.new(C,0,X)
  1075. end
  1076. local m = V - C
  1077. return Color3.new(color.r + m, color.g + m, color.b + m)
  1078. end
  1079.  
  1080. function GetWeld(weld)
  1081. if weld:findFirstChild("XAngle") == nil then
  1082. local a = Instance.new("NumberValue", weld)
  1083. a.Name = "XAngle"
  1084. end
  1085. if weld:findFirstChild("YAngle") == nil then
  1086. local a = Instance.new("NumberValue", weld)
  1087. a.Name = "YAngle"
  1088. end
  1089. if weld:findFirstChild("ZAngle") == nil then
  1090. local a = Instance.new("NumberValue", weld)
  1091. a.Name = "ZAngle"
  1092. end
  1093. return weld.C0.p, Vector3.new(weld.XAngle.Value, weld.YAngle.Value, weld.ZAngle.Value)
  1094. end
  1095.  
  1096. function SetWeld(weld, i, loops, origpos,origangle, nextpos,nextangle)
  1097. if weld:findFirstChild("XAngle") == nil then
  1098. local a = Instance.new("NumberValue", weld)
  1099. a.Name = "XAngle"
  1100. end
  1101. if weld:findFirstChild("YAngle") == nil then
  1102. local a = Instance.new("NumberValue", weld)
  1103. a.Name = "YAngle"
  1104. end
  1105. if weld:findFirstChild("ZAngle") == nil then
  1106. local a = Instance.new("NumberValue", weld)
  1107. a.Name = "ZAngle"
  1108. end
  1109.  
  1110. local tox,toy,toz = 0,0,0
  1111. if origangle.x > nextangle.x then
  1112. tox = -math.abs(origangle.x - nextangle.x) /loops*i
  1113. else
  1114. tox = math.abs(origangle.x - nextangle.x) /loops*i
  1115. end
  1116. if origangle.y > nextangle.y then
  1117. toy = -math.abs(origangle.y - nextangle.y) /loops*i
  1118. else
  1119. toy = math.abs(origangle.y - nextangle.y) /loops*i
  1120. end
  1121. if origangle.z > nextangle.z then
  1122. toz = -math.abs(origangle.z - nextangle.z) /loops*i
  1123. else
  1124. toz = math.abs(origangle.z - nextangle.z) /loops*i
  1125. end
  1126.  
  1127. local tox2,toy2,toz2 = 0,0,0
  1128. if origpos.x > nextpos.x then
  1129. tox2 = -math.abs(origpos.x - nextpos.x) /loops*i
  1130. else
  1131. tox2 = math.abs(origpos.x - nextpos.x) /loops*i
  1132. end
  1133. if origpos.y > nextpos.y then
  1134. toy2 = -math.abs(origpos.y - nextpos.y) /loops*i
  1135. else
  1136. toy2 = math.abs(origpos.y - nextpos.y) /loops*i
  1137. end
  1138. if origpos.z > nextpos.z then
  1139. toz2 = -math.abs(origpos.z - nextpos.z) /loops*i
  1140. else
  1141. toz2 = math.abs(origpos.z - nextpos.z) /loops*i
  1142. end
  1143.  
  1144. weld.XAngle.Value = origangle.x + tox
  1145. weld.YAngle.Value = origangle.y + toy
  1146. weld.ZAngle.Value = origangle.z + toz
  1147. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  1148. end
  1149.  
  1150. function LoadTextures()
  1151. local pls = game:service("ContentProvider")
  1152. for i, v in pairs(loadids) do
  1153. pls:Preload("http://www.roblox.com/asset/?id="..v)
  1154. wait(0.04)
  1155. end
  1156. end
  1157. LoadTextures()
  1158.  
  1159. function CreateGui()
  1160. for i, v in pairs(player.PlayerGui:children()) do
  1161. if v.className == "ScreenGui" and v.Name == "staminaGui" then
  1162. v:remove()
  1163. end
  1164. end
  1165. local g = Instance.new("ScreenGui", player.PlayerGui)
  1166. g.Name = "staminaGui"
  1167.  
  1168. local c = Instance.new("Frame", g)
  1169. c.Visible = false
  1170. c.Size = UDim2.new(0,86,0,320)
  1171. c.BackgroundTransparency = 1
  1172. c.Position = UDim2.new(1,-96,0.5,-160)
  1173. c.Name = "Container"
  1174.  
  1175. local t = Instance.new("TextLabel", c)
  1176. t.Size = UDim2.new(0,0,-0.1,0)
  1177. t.Position = UDim2.new(0.3,0,0.5,0)
  1178. t.TextXAlignment = "Right"
  1179. t.Font = "ArialBold"
  1180. t.TextTransparency = 0.1
  1181. t.TextColor3 = Color3.new(0,0.6,0.8)
  1182. t.TextStrokeColor3 = Color3.new(0,0.2,0.8)
  1183. t.TextStrokeTransparency = 0.3
  1184. t.FontSize = 6
  1185. t.BackgroundTransparency = 1
  1186. local t2 = t:Clone()
  1187. t2.Parent = c
  1188. t2.Size = UDim2.new(0,0,0.1,0)
  1189. local l = t:Clone()
  1190. l.Parent = c
  1191. l.Size = UDim2.new(0,0,0,0)
  1192. l.Text = "-----"
  1193.  
  1194. local f1 = Instance.new("Frame", c)
  1195. f1.Name = "Backing"
  1196. f1.ClipsDescendants = true
  1197. f1.Size = UDim2.new(1,0,0,0)
  1198. f1.BackgroundColor3 = Color3.new(0.8,0,0)
  1199. f1.BackgroundTransparency = 1
  1200. local f1img = Instance.new("ImageLabel", f1)
  1201. f1img.BackgroundTransparency = 1
  1202. f1img.Image = "http://www.roblox.com/asset/?id=112474909"
  1203. f1img.Size = UDim2.new(1,0,0,c.Size.Y.Offset)
  1204.  
  1205. local f2 = Instance.new("Frame", c)
  1206. f2.Name = "Overlay"
  1207. f2.ClipsDescendants = true
  1208. f2.Size = UDim2.new(1,0,1,0)
  1209. f2.BackgroundColor3 = Color3.new(0,0,0.8)
  1210. f2.BackgroundTransparency = 1
  1211. local f2img = Instance.new("ImageLabel", f2)
  1212. f2img.BackgroundTransparency = 1
  1213. f2img.Image = "http://www.roblox.com/asset/?id=112474911"
  1214. f2img.Size = UDim2.new(1,0,0,c.Size.Y.Offset)
  1215.  
  1216. function Calculate()
  1217. local ysize = c.Size.Y.Offset
  1218. local per = (stamina/maxstamina) * c.Size.Y.Offset
  1219. local rem = (-(stamina/maxstamina-1)) * c.Size.Y.Offset
  1220. f1.Size = UDim2.new(1,0,0,rem)
  1221. f2.Size = UDim2.new(1,0,0,per)
  1222. f2.Position = UDim2.new(0,0,0,rem)
  1223. f2img.Position = UDim2.new(0,0,0,-rem)
  1224. t.Text = math.floor(stamina)
  1225. t2.Text = maxstamina
  1226. end
  1227. Calculate()
  1228.  
  1229. wait(0.01)
  1230. c.Visible = true
  1231. end
  1232. CreateGui()
  1233.  
  1234. player.CharacterAdded:connect(function()
  1235. char = player.Character
  1236. Torsoz = char:findFirstChild("Torso")
  1237. RA = char:findFirstChild("Right Arm")
  1238. LA = char:findFirstChild("Left Arm")
  1239. RL = char:findFirstChild("Right Leg")
  1240. LL = char:findFirstChild("Left Leg")
  1241. H = char:findFirstChild("Head")
  1242. Hu = char:findFirstChild("Humanoid")
  1243. RS = Torsoz:findFirstChild("Right Shoulder")
  1244. LS = Torsoz:findFirstChild("Left Shoulder")
  1245. RH = Torsoz:findFirstChild("Right Hip")
  1246. LH = Torsoz:findFirstChild("Left Hip")
  1247. N = Torsoz:findFirstChild("Neck")
  1248. stamina = maxstamina
  1249. CreateGui()
  1250. end)
  1251.  
  1252. function RAY(pos, dir, startpos, endpos, distleft, collidedlist)
  1253. collidedlist = collidedlist or {char}
  1254. startpos = startpos or pos
  1255. distleft = distleft or dir.unit * dir.magnitude
  1256. endpos = endpos or pos + distleft
  1257. local ray = Ray.new(pos, distleft)
  1258. local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
  1259. --[[
  1260. local p = P:Clone()
  1261. p.Parent = char
  1262. p.Size = Vector3.new(0.4,0.4,0.4)
  1263. p.BrickColor = BrickColor.new("Lime green")
  1264. p.CanCollide = false
  1265. p.CFrame = CFrame.new(enz)
  1266. p.Transparency = 0.3
  1267. ]]
  1268. if hitz ~= nil then
  1269. if hitz.CanCollide == false then
  1270. table.insert(collidedlist, hitz)
  1271. local newpos = enz
  1272. local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
  1273. if newdistleft ~= NV then
  1274. return RAY(newpos-(dir*0.01), dir, startpos, endpos, newdistleft+(dir*0.01), collidedlist)
  1275. end
  1276. end
  1277. end
  1278.  
  1279. return hitz, enz, ray
  1280. end
  1281.  
  1282. function Sit()
  1283. Standing = false
  1284. local hitz,enz = RAY(Torsoz.Position, Vector3.new(0,-4.1,0))
  1285. local tordir = Vector3.new(Torsoz.CFrame.lookVector.x,0,Torsoz.CFrame.lookVector.z)
  1286. if (hitz ~= nil and hitz.CanCollide == true) then
  1287. local cf = CFrame.new(enz+Vector3.new(0,1.28,0), enz+Vector3.new(0,1.28,0)+tordir) * CFrame.Angles(math.pi/6,0,0)
  1288. local hitz2,enz2 = RAY(enz+Vector3.new(0,2.25,0), tordir*-2.2)
  1289. Hu.PlatformStand = true
  1290. Torsoz.CFrame = cf
  1291. local bp = Instance.new("BodyPosition", Torsoz)
  1292. bp.Name = "StaminaBodyObject"
  1293. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  1294. bp.D = 100
  1295. bp.position = cf.p
  1296. local bg = Instance.new("BodyGyro", Torsoz)
  1297. bg.Name = "StaminaBodyObject"
  1298. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1299. bg.cframe = cf
  1300. bg.D = 100
  1301. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.34,-1,0.2), Vector3.new((math.pi/2)-(math.pi/6),0,math.pi/8))
  1302. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.34,-1,0.2), Vector3.new((math.pi/2)-(math.pi/6),0,-math.pi/8))
  1303.  
  1304. if hitz2 ~= nil and hitz2.CanCollide == true then
  1305. Joint3.C0 = CFrame.new(0.9,0.4,-0.45) * CFrame.Angles(0,math.pi/2.13,0) * CFrame.Angles(math.pi/2.3,0,0)
  1306. Joint4.C0 = CFrame.new(-0.9,0.4,-0.4) * CFrame.Angles(0,-math.pi/2.05,0) * CFrame.Angles(math.pi/2.3,0,0)
  1307. Joint5.C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.pi/8.8,0,0)
  1308. else
  1309. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.4,0.4,0.1), Vector3.new(-(math.pi/6)-(math.pi/10),0,math.pi/9))
  1310. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.4,0.4,0.1), Vector3.new(-(math.pi/6)-(math.pi/10),0,-math.pi/9))
  1311. SetWeld(Joint5,1,1, NV,NV, Vector3.new(0,1,0), Vector3.new(-math.pi/12,0,0))
  1312. end
  1313.  
  1314. Sitting = true
  1315. Action = "Sitting"
  1316. end
  1317. end
  1318.  
  1319.  
  1320. function Stand()
  1321. Hu.PlatformStand = false
  1322. if Sitting == true then
  1323. local tordir = Torsoz.Position + (Torsoz.CFrame.lookVector*10000)
  1324. local cf = CFrame.new(Torsoz.Position + Vector3.new(0,1.8,0), Vector3.new(tordir.x,Torsoz.Position.y,tordir.z))
  1325. Torsoz.CFrame = cf
  1326. end
  1327. for i, v in pairs(Torsoz:children()) do
  1328. if v.Name == "StaminaBodyObject" then
  1329. v:remove()
  1330. end
  1331. end
  1332. RH.Part0 = nil
  1333. LH.Part0 = nil
  1334. RS.Part0 = nil
  1335. LS.Part0 = nil
  1336. Joint1.Part0 = Torsoz
  1337. Joint1.Part1 = RL
  1338. Joint1.C0 = CFrame.new(0.5,-1,0)
  1339. Joint1.C1 = CFrame.new(0,1,0)
  1340. Joint2.Part0 = Torsoz
  1341. Joint2.Part1 = LL
  1342. Joint2.C0 = CFrame.new(-0.5,-1,0)
  1343. Joint2.C1 = CFrame.new(0,1,0)
  1344. Joint3.Part0 = Torsoz
  1345. Joint3.Part1 = RA
  1346. Joint3.C0 = CFrame.new(1.5,0.5,0)
  1347. Joint3.C1 = CFrame.new(0,0.5,0)
  1348. Joint4.Part0 = Torsoz
  1349. Joint4.Part1 = LA
  1350. Joint4.C0 = CFrame.new(-1.5,0.5,0)
  1351. Joint4.C1 = CFrame.new(0,0.5,0)
  1352. Joint5.Part0 = Torsoz
  1353. Joint5.Part1 = H
  1354. Joint5.C0 = CFrame.new(0,1,0)
  1355. Joint5.C1 = CFrame.new(0,-0.5,0)
  1356. Sitting = false
  1357. Diving = false
  1358. Standing = true
  1359. Action = "Standing"
  1360. end
  1361.  
  1362. --------------------------------------- Dive ----------------------------------
  1363.  
  1364. function Dive()
  1365. stamina = stamina - 10
  1366. flow.Value = flow.Value + 10
  1367. if flow.Value > 100 then
  1368. flow.Value = 100
  1369. end
  1370. Standing = false
  1371. local dir = Vector3.new(Torsoz.CFrame.lookVector.x,0,Torsoz.CFrame.lookVector.z)
  1372. GravPoint = 18
  1373. DivingDir = dir
  1374. local cf = CFrame.new(Torsoz.Position, dir+Vector3.new(0,Torsoz.Position.y,0))
  1375. DivingCF = cf
  1376. DivingDir = dir
  1377. Hu.PlatformStand = true
  1378. local bv = Instance.new("BodyVelocity", Torsoz)
  1379. bv.Name = "StaminaBodyObject"
  1380. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  1381. bv.velocity = Vector3.new(DivingDir.x*24,GravPoint,DivingDir.z*24)
  1382. DivingBV = bv
  1383. local bg = Instance.new("BodyGyro", Torsoz)
  1384. bg.Name = "StaminaBodyObject"
  1385. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1386. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+bv.velocity) * CFrame.Angles(-math.pi/2,0,0)
  1387. bg.D = 100
  1388. DivingBG = bg
  1389.  
  1390. local joint = Joint3
  1391. joint.C1 = CFrame.new(0,0.5,0)
  1392. local joint2 = Joint4
  1393. joint2.C1 = CFrame.new(0,0.5,0)
  1394. local joint3 = Joint1
  1395. joint3.C1 = CFrame.new(0,1,0)
  1396. local joint4 = Joint2
  1397. joint4.C1 = CFrame.new(0,1,0)
  1398.  
  1399. local joint5 = Joint5
  1400.  
  1401. Diving = true
  1402. Action = "Diving"
  1403.  
  1404. for i = 1, 8 do
  1405. SetWeld(joint,i,8, Vector3.new(1.5,0.5,0), NV, Vector3.new(1.45,0.5,0.1), Vector3.new(-0.2,-math.pi/9,math.pi/13))
  1406. SetWeld(joint2,i,8, Vector3.new(-1.5,0.5,0), NV, Vector3.new(-1.45,0.5,0.1), Vector3.new(-0.2,math.pi/9,-math.pi/13))
  1407. SetWeld(joint3,i,8, Vector3.new(0.5,-1,0), NV, Vector3.new(0.5,-1,0.03), Vector3.new(-0.2,-math.pi/10,math.pi/14))
  1408. SetWeld(joint4,i,8, Vector3.new(-0.5,-1,0), NV, Vector3.new(-0.5,-1,0.03), Vector3.new(-0.2,math.pi/10,-math.pi/14))
  1409. SetWeld(joint5,i,8, Vector3.new(0,1,0), NV, Vector3.new(0,1,0), Vector3.new(0.45,0,0))
  1410. wait(0.025)
  1411. end
  1412.  
  1413. local counter = 0
  1414. while Diving == true do
  1415. counter = counter + 1
  1416. bg.Parent = Torsoz
  1417. local hitz, enz = RAY(Torsoz.Position, bv.velocity.unit*4.6)
  1418. if hitz ~= nil and hitz.CanCollide == true then
  1419. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  1420. if hitz2 ~= nil then
  1421. Diving = "Rolling"
  1422. Action = "DiveRolling"
  1423. else
  1424. Torsoz.CFrame = Torsoz.CFrame * CFrame.new(0,-0.3,0)
  1425. Torsoz.Velocity = NV
  1426. flow.Value = 0
  1427. break
  1428. end
  1429. end
  1430. if counter > 190 then
  1431. break
  1432. end
  1433. wait(0.02)
  1434. end
  1435.  
  1436. bv.velocity = (dir*20) + Vector3.new(0,-0.5,0)
  1437.  
  1438. local bgcf = bg.cframe
  1439. local haslanded = false
  1440. local count = 0
  1441.  
  1442. while haslanded == false do
  1443. bg.cframe = bgcf * CFrame.Angles(-0.3*count,0,0)
  1444. local hitz, enz = RAY(Torsoz.Position, ((Torsoz.CFrame*CFrame.new(0,-1,0)).p - Torsoz.CFrame.p).unit*1.6)
  1445. if hitz ~= nil and hitz.CanCollide == true then
  1446. haslanded = true
  1447. end
  1448. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-3.8,0))
  1449. if hitz2 == nil then
  1450. Torsoz.Velocity = NV
  1451. break
  1452. elseif haslanded == true then
  1453. local bp = Instance.new("BodyPosition", Torsoz)
  1454. bp.Name = "StaminaJumpFix"
  1455. bp.maxForce = Vector3.new(0,1/0,0)
  1456. bp.P = 7000
  1457. bp.position = enz2 + Vector3.new(0,2.8,0)
  1458. game:service("Debris"):AddItem(bp, 0.3)
  1459. else
  1460. bv.velocity = (dir*20) + Vector3.new(0,-(Torsoz.Position - enz2).magnitude*3,0)
  1461.  
  1462. end
  1463. count = count + 1
  1464. if count <= 6 then
  1465. local i = count
  1466. local j1,j1a = GetWeld(joint)
  1467. local j2,j2a = GetWeld(joint2)
  1468. local j3,j3a = GetWeld(joint3)
  1469. local j4,j4a = GetWeld(joint4)
  1470. local j5,j5a = GetWeld(joint5)
  1471. SetWeld(joint,i,6, j1,j1a, Vector3.new(1.35,0.5,-0.2), Vector3.new(math.pi/2.6,0,-math.pi/5.8))
  1472. SetWeld(joint2,i,6, j2,j2a, Vector3.new(-1.35,0.5,-0.2), Vector3.new(math.pi/2.6,0,math.pi/5.8))
  1473. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.51,0.4,-0.6), Vector3.new(-0.1,0,0.05))
  1474. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.51,0.4,-0.6), Vector3.new(-0.1,0,-0.05))
  1475. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,1,0), Vector3.new(-0.4,0,0))
  1476. elseif count >= 50 then
  1477. break
  1478. end
  1479. wait(0.02)
  1480. end
  1481.  
  1482. Torsoz.Velocity = NV
  1483.  
  1484. Stand()
  1485. DivingCooldown = 9
  1486. end
  1487.  
  1488. function FindSurface(part, position)
  1489. local obj = part.CFrame:pointToObjectSpace(position)
  1490. local siz = part.Size/2
  1491. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  1492. local vec = Vector3.FromNormalId(v)
  1493. local wvec = part.CFrame:vectorToWorldSpace(vec)
  1494. local vz = (obj)/(siz*vec)
  1495. if (math.abs(vz.X-1) < 0.01 or math.abs(vz.Y-1) < 0.01 or math.abs(vz.Z-1) < 0.01) then
  1496. return wvec,vec
  1497. end
  1498. end
  1499. if part.className == "WedgePart" then
  1500. return part.CFrame:vectorToWorldSpace(Vector3.new(0,0.707,-0.707)), Vector3.new(0,0.707,-0.707)
  1501. end
  1502. end
  1503.  
  1504. function HWallRun(part, pos, side)
  1505. if (part.className == "Part" and part.Shape == Enum.PartType.Block) or part.className ~= "Part" then
  1506. flow.Value = flow.Value + 9
  1507. Standing = false
  1508. HWallRunning = true
  1509. Action = "HWallRunning"
  1510. GravPoint = 10
  1511. HWRLastPart = part
  1512. local dir, dirc = FindSurface(part, pos)
  1513. towall = -dir
  1514. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  1515.  
  1516. local bv = Instance.new("BodyVelocity", Torsoz)
  1517. bv.Name = "StaminaBodyObject"
  1518. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  1519. bv.P = 9000
  1520. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  1521. local bg = Instance.new("BodyGyro", Torsoz)
  1522. bg.Name = "StaminaBodyObject"
  1523. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1524. bg.cframe = CFrame.new(Torsoz.Position+(towall*-2), Torsoz.Position) * CFrame.Angles(0,-side,-side/4.2)
  1525. bg.D = 100
  1526.  
  1527. local sid = Instance.new("Snap")
  1528.  
  1529. local joint1 = Joint3
  1530. if side == -math.pi/2 then
  1531. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(math.pi/1.3,0.1,math.pi/2.5))
  1532. else
  1533. sid = joint1
  1534. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.6,0), Vector3.new(-math.pi/12,0,math.pi/7))
  1535. end
  1536. local j1c0 = joint1.C0
  1537.  
  1538. local joint2 = Joint4
  1539. if side == math.pi/2 then
  1540. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(math.pi/1.3,-0.1,-math.pi/2.5))
  1541. else
  1542. sid = joint2
  1543. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.6,0), Vector3.new(-math.pi/12,0,-math.pi/7))
  1544. end
  1545. local j2c0 = joint2.C0
  1546.  
  1547. local joint3 = Joint1
  1548. joint3.C1 = CFrame.new(0,1,0)
  1549. if side == -math.pi/2 then
  1550. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.38,-0.3), Vector3.new(0,math.pi/2,0.14))
  1551. else
  1552. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.8,-0.2), Vector3.new(0,math.pi/2,0.2))
  1553. end
  1554.  
  1555. local joint4 = Joint2
  1556. joint4.C1 = CFrame.new(0,1,0)
  1557. if side == -math.pi/2 then
  1558. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.8,-0.2), Vector3.new(0,0,0.2))
  1559. else
  1560. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.38,-0.3), Vector3.new(0,0,0.14))
  1561. end
  1562.  
  1563. local joint5 = Joint5
  1564. SetWeld(joint5,1,1,NV,NV,Vector3.new(0,0.9,0),Vector3.new(0,0,side/7))
  1565.  
  1566. Torsoz.CFrame = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  1567. bg.cframe = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  1568.  
  1569. local aniangle = 0
  1570. local aniplus = true
  1571. local aniangle2 = 0
  1572. local aniplus2 = true
  1573.  
  1574. local prevpart = part
  1575. HWRLastPart = part
  1576. while HWallRunning == true do
  1577.  
  1578. if aniangle > math.pi then
  1579. aniplus = false
  1580. elseif aniangle < -math.pi then
  1581. aniplus = true
  1582. end
  1583. if aniplus == true then
  1584. aniangle = aniangle + 0.95
  1585. elseif aniplus == false then
  1586. aniangle = aniangle - 0.95
  1587. end
  1588.  
  1589. if aniangle2 > math.pi then
  1590. aniplus2 = false
  1591. elseif aniangle2 < -math.pi then
  1592. aniplus2 = true
  1593. end
  1594. if aniplus2 == true then
  1595. aniangle2 = aniangle2 + 0.23
  1596. elseif aniplus2 == false then
  1597. aniangle2 = aniangle2 - 0.23
  1598. end
  1599.  
  1600. Hu.PlatformStand = true
  1601. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-3,0))
  1602. local hitz2, enz2 = RAY(Torsoz.Position, towall*3.4)
  1603.  
  1604. --- if player ends wall run on ground
  1605. if hitz ~= nil and hitz.CanCollide == true then
  1606. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  1607. local offset = (bg.cframe.p.y+enz2.y) - bg.cframe.p.y
  1608. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  1609. Torsoz.Velocity = NV
  1610. break
  1611. end
  1612.  
  1613. ---- if new wall found --------
  1614. if hitz2 ~= nil and hitz2.CanCollide == true then
  1615. if hitz2 ~= prevpart then
  1616. local direct = CFrame.new(Torsoz.Position, Torsoz.Position+dir) * CFrame.Angles(0,side,0)
  1617. local hitz3, enz3 = RAY(Torsoz.Position, (direct * CFrame.Angles(0,-side/2.3,0)).lookVector*4)
  1618. if hitz3 ~= nil then
  1619. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  1620. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  1621. dir, dirc = FindSurface(hitz2, enz2)
  1622. towall = -dir
  1623. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  1624. prevpart = hitz2
  1625. HWRLastPart = hitz2
  1626. else
  1627. ---- if player fails to find new wall to run on
  1628. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1629. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1630. Torsoz.Velocity = NV
  1631. HWRCooldown = 5
  1632. break
  1633. end
  1634. end
  1635. --- continue to wall run
  1636. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  1637. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  1638. else
  1639. ---- if player ends wall run at end of wall
  1640. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1641. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1642. Torsoz.Velocity = NV
  1643. HWRCooldown = 5
  1644. break
  1645. end
  1646.  
  1647. local hitz3, enz3 = RAY(Torsoz.Position, Torsoz.CFrame.lookVector*2)
  1648. if hitz3 ~= nil and hitz3.CanCollide == true then
  1649. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1650. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1651. Torsoz.Velocity = NV
  1652. HWRCooldown = 5
  1653. break
  1654. end
  1655.  
  1656. bv.Parent = Torsoz
  1657. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  1658. bg.cframe = bg.cframe * CFrame.Angles(aniangle/80,aniangle/80,0)
  1659. Torsoz.CFrame = Torsoz.CFrame * CFrame.Angles(aniangle/80,aniangle/80,0)
  1660. local j3,j3a = GetWeld(joint3)
  1661. local j4,j4a = GetWeld(joint4)
  1662. SetWeld(joint3,1,1, j3,j3a, j3,Vector3.new(-0.2+(aniangle/4),0,0))
  1663. SetWeld(joint4,1,1, j4,j4a, j4,Vector3.new(-0.2+(-aniangle/4),0,0))
  1664. if side == math.pi/2 then
  1665. local j1,j1a = GetWeld(joint1)
  1666. SetWeld(joint1,1,1, j1,j1a, j1, Vector3.new(0,0,0.8+(aniangle2/14)))
  1667. else
  1668. local j2,j2a = GetWeld(joint2)
  1669. SetWeld(joint2,1,1, j2,j2a, j2, Vector3.new(0,0,-0.8-(aniangle2/14)))
  1670. end
  1671.  
  1672. wait(0.025)
  1673. if GravPoint < -100 then
  1674. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  1675. local offset = math.abs((bg.cframe.p.y+enz2.y) - bg.cframe.p.y)
  1676. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  1677. break
  1678. end
  1679.  
  1680. end
  1681.  
  1682. if HWallRunning == "Jumping" then
  1683. HWRCooldown = 6
  1684. joint1.C1 = CFrame.new(0,0.5,0)
  1685.  
  1686. joint2.C1 = CFrame.new(0,0.5,0)
  1687. if side == -math.pi/2 then
  1688. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/3)
  1689. else
  1690. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/4)
  1691. end
  1692.  
  1693. joint3.C1 = CFrame.new(0,1,0)
  1694. if side == -math.pi/2 then
  1695. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),-math.pi/4)
  1696. else
  1697. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),math.pi/4)
  1698. end
  1699. joint4.MaxVelocity = 10
  1700. joint4.DesiredAngle = 0
  1701. joint4.C1 = CFrame.new(0,1,0)
  1702. if side == -math.pi/2 then
  1703. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),math.pi/4)
  1704. else
  1705. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),-math.pi/4)
  1706. end
  1707.  
  1708. local joint5 = Joint5
  1709. joint5.C1 = CFrame.new(0,-0.5,0) * CFrame.Angles(0,side/2.4,0)
  1710. joint5.C0 = CFrame.new(0,1,0)
  1711.  
  1712. local j1,j1a = GetWeld(joint1)
  1713. local j2,j2a = GetWeld(joint2)
  1714. local j3,j3a = GetWeld(joint3)
  1715. local j4,j4a = GetWeld(joint4)
  1716. local j5,j5a = GetWeld(joint5)
  1717.  
  1718. GravPoint = 26
  1719. local collidecount = 0
  1720. local bgangle = side/2
  1721. local count = 1
  1722. local dir2 = (CFrame.new(NV, dir) * CFrame.Angles(0,-side/2.4,0)).lookVector
  1723. HWRDir = dir2
  1724. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  1725. while HWallRunning == "Jumping" do
  1726. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  1727. local hitz2, enz2 = RAY(Torsoz.Position, dir2*1.4)
  1728. if hitz ~= nil and hitz.CanCollide == true then
  1729. local offset = math.abs(enz.y - Torsoz.CFrame.p.y)
  1730. Torsoz.CFrame = CFrame.new(enz+Vector3.new(0,2.9,0), enz+Vector3.new(0,2.9,0)+dir2)
  1731. Torsoz.Velocity = NV
  1732. break
  1733. end
  1734.  
  1735. if hitz2 ~= nil and hitz2.CanCollide == true then
  1736. collidecount = collidecount + 1
  1737. if collidecount == 4 then
  1738. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir2) * CFrame.new(0,0,0.4)
  1739. Torsoz.Velocity = Vector3.new(0,Torsoz.Velocity.y,0)
  1740. HWRCooldown = 5
  1741. VWRCooldown = 5
  1742. wait(0.02)
  1743. break
  1744. end
  1745. end
  1746.  
  1747. if side/2 > 0 then
  1748. if bgangle > 0.2 then
  1749. bgangle = bgangle - 0.055
  1750. end
  1751. else
  1752. if bgangle < -0.2 then
  1753. bgangle = bgangle + 0.055
  1754. end
  1755. end
  1756.  
  1757. if count <= 5 then
  1758. if side == -math.pi/2 then
  1759. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/4))
  1760. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/3))
  1761. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1762. joint3.C0 = joint3.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  1763. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1764. joint4.C0 = joint4.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  1765. else
  1766. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/3))
  1767. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/4))
  1768. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1769. joint3.C0 = joint3.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  1770. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1771. joint4.C0 = joint4.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  1772. end
  1773.  
  1774. count = count + 1
  1775. end
  1776.  
  1777. bg.Parent = Torsoz
  1778. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles(0,side/15,-bgangle)
  1779. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  1780. if collidecount ~= 0 then
  1781. bv.velocity = Vector3.new(0,bv.velocity.y,0)
  1782. end
  1783. if GravPoint < -120 then
  1784. break
  1785. end
  1786. wait(0.025)
  1787. end
  1788. end
  1789.  
  1790. Hu.PlatformStand = false
  1791. bv:remove()
  1792.  
  1793. HWRGravDrop = false
  1794. Stand()
  1795. HWallRunning = false
  1796. end
  1797. end
  1798.  
  1799. function VWR(part, pos)
  1800. if (part.className == "Part" and part.Shape == Enum.PartType.Block) or part.className ~= "Part" then
  1801. print("VWR Activated")
  1802. flow.Value = flow.Value + 9
  1803. Standing = false
  1804. VWallRunning = true
  1805. Action = "VWallRunning"
  1806. GravPoint = 0
  1807. local percent = 1
  1808. VWRLastPart = part
  1809. local dir, dirc = FindSurface(part, pos)
  1810. towall = -dir
  1811. dir = (CFrame.new(NV, -dir) * CFrame.Angles(math.pi/2,0,0)).lookVector
  1812. --[[
  1813. local p = P:Clone()
  1814. p.Parent = char
  1815. p.Size = Vector3.new(2,2,2)
  1816. p.BrickColor = BrickColor.new("Lime green")
  1817. p.CanCollide = false
  1818. p.CFrame = part.CFrame * CFrame.new(dirc*5)
  1819. p.Transparency = 0.3
  1820. ]]
  1821. local bv = Instance.new("BodyVelocity", Torsoz)
  1822. bv.Name = "StaminaBodyObject"
  1823. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  1824. bv.P = 9000
  1825. bv.velocity = (dir*(sprint-1))*percent
  1826.  
  1827. local bg = Instance.new("BodyGyro", Torsoz)
  1828. bg.Name = "StaminaBodyObject"
  1829. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1830. bg.D = 100
  1831. local posi = pos + (-towall*1.8)
  1832. bg.cframe = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0)
  1833. Torsoz.CFrame = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0)
  1834.  
  1835. local joint1 = Joint3
  1836. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,0,math.pi/8))
  1837.  
  1838. local joint2 = Joint4
  1839. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,0,-math.pi/8))
  1840.  
  1841. local joint3 = Joint1
  1842. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.48,-0.6,-0.1), Vector3.new(0,math.pi/2,0))
  1843. joint3.C1 = CFrame.new(0,0.7,0.2) * CFrame.Angles(0,math.pi/2,0)
  1844.  
  1845. local joint4 = Joint2
  1846. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.48,-0.6,-0.1), Vector3.new(0,math.pi/2,0))
  1847. joint4.C1 = CFrame.new(0,0.7,0.2) * CFrame.Angles(0,math.pi/2,0)
  1848.  
  1849. local joint5 = Joint5
  1850. SetWeld(joint5,1,1, NV,NV, Vector3.new(0,1,0), Vector3.new(math.pi/20,0,0))
  1851.  
  1852. local aniangle = 0
  1853. local aniplus = true
  1854.  
  1855. while VWallRunning == true do
  1856. local hitz, enz = RAY(Torsoz.Position, towall*2.1)
  1857. local hitz2, enz2 = RAY(Torsoz.Position, (CFrame.new(NV,towall)*CFrame.Angles(math.pi/2,0,0)).lookVector*2.4)
  1858.  
  1859. if aniangle > math.pi then
  1860. aniplus = false
  1861. elseif aniangle < -math.pi then
  1862. aniplus = true
  1863. end
  1864. if aniplus == true then
  1865. aniangle = aniangle + (1.3*(percent+0.2))
  1866. elseif aniplus == false then
  1867. aniangle = aniangle - (1.3*(percent+0.2))
  1868. end
  1869.  
  1870. bv.velocity = (dir*(sprint-1))*percent
  1871. if VWRLeft == true then
  1872. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * (11*percent+5))
  1873. end
  1874. if VWRRight == true then
  1875. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * (11*percent+5))
  1876. end
  1877.  
  1878. bg.cframe = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0) * CFrame.Angles(0,aniangle/60,0)
  1879.  
  1880. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,aniangle/52,(math.pi/8)+(aniangle/30)))
  1881. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,aniangle/52,(-math.pi/8)+(-aniangle/30)))
  1882. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.51,-0.75,-(aniangle/30)), Vector3.new(0,math.pi/2,(aniangle/8)-0.3))
  1883. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.51,-0.75,(aniangle/30)), Vector3.new(0,math.pi/2,(-aniangle/8)-0.3))
  1884.  
  1885. if hitz == nil then
  1886. local lv = Torsoz.Position + (Torsoz.CFrame.lookVector*100)
  1887. Torsoz.CFrame = CFrame.new(Torsoz.Position, Vector3.new(lv.x,Torsoz.Position.y,lv.z))
  1888. break
  1889. end
  1890.  
  1891. if hitz2 ~= nil then
  1892. percent = 0
  1893. VWallRunning = "Falling"
  1894. Action = "VWRFalling"
  1895. GravPoint = -7
  1896. break
  1897. end
  1898.  
  1899. wait(0.02)
  1900. percent = percent - 0.028
  1901. if percent <= 0.15 then
  1902. VWallRunning = "Falling"
  1903. Action = "VWRFalling"
  1904. end
  1905. end
  1906.  
  1907. -------------------------- Falling from VWR ------------------------------
  1908. if VWallRunning == "Falling" then
  1909. GravPoint = GravPoint - 1
  1910. local dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1911. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1912.  
  1913. local j1,j1a = GetWeld(joint1)
  1914. local j2,j2a = GetWeld(joint2)
  1915. local j3,j3a = GetWeld(joint3)
  1916. local j4,j4a = GetWeld(joint4)
  1917. local j5,j5a = GetWeld(joint5)
  1918.  
  1919. local counter = 0
  1920. while VWallRunning == "Falling" do
  1921. counter = counter + 1
  1922. local hitz, enz = RAY(H.Position, Vector3.new(0,-2.4,0))
  1923.  
  1924. dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1925. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1926. if VWRLeft == true then
  1927. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1928. end
  1929. if VWRRight == true then
  1930. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1931. end
  1932. bg.cframe = CFrame.new(NV, (-towall*30) + Vector3.new(0,GravPoint,0)) * CFrame.Angles(-math.pi/2.55,math.pi,0)
  1933.  
  1934. if counter <= 35 then
  1935. SetWeld(joint1,counter,35, j1,j1a, Vector3.new(1.4,0.45,-0.1), Vector3.new(math.pi/9,0,math.pi/9))
  1936. SetWeld(joint2,counter,35, j2,j2a, Vector3.new(-1.4,0.45,-0.1), Vector3.new(math.pi/9,0,-math.pi/9))
  1937. SetWeld(joint3,counter,35, j3,j3a, Vector3.new(0.5,-0.75,0), Vector3.new(0,math.pi/2,math.pi/9))
  1938. joint3.C1 = CFrame.new(0,0.7 + (0.3/35*counter),0.2 - (0.2/35*counter)) * CFrame.Angles(0,math.pi/2,0)
  1939. SetWeld(joint4,counter,35, j4,j4a, Vector3.new(-0.5,-0.75,0), Vector3.new(0,math.pi/2,math.pi/9))
  1940. joint4.C1 = CFrame.new(0,0.7 + (0.3/35*counter),0.2 - (0.2/35*counter)) * CFrame.Angles(0,math.pi/2,0)
  1941. SetWeld(joint5,counter,35, j5,j5a, Vector3.new(0,1,0), Vector3.new(-math.pi/6,0,0))
  1942. end
  1943.  
  1944. if hitz ~= nil then
  1945. bv:remove()
  1946. Torsoz.CFrame = CFrame.new(enz+Vector3.new(0,2,0), (enz+Vector3.new(0,2,0)) + ((-towall*25) + Vector3.new(0,GravPoint,0))) * CFrame.Angles(-math.pi/2.55,math.pi,0)
  1947. Torsoz.Velocity = NV
  1948. Torsoz.RotVelocity = NV
  1949. local bp = Instance.new("BodyPosition", Torsoz)
  1950. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  1951. bp.position = Torsoz.CFrame.p
  1952. game:service("Debris"):AddItem(bp, 0.16)
  1953. flow.Value = 0
  1954. break
  1955. end
  1956.  
  1957. if GravPoint > - 180 then
  1958. GravPoint = GravPoint - 1.9
  1959. end
  1960. if counter > 200 then
  1961. break
  1962. end
  1963. wait(0.02)
  1964. end
  1965.  
  1966. local bp = Instance.new("BodyPosition")
  1967.  
  1968. local counter2 = counter
  1969. local bgangleplus = 0
  1970.  
  1971. local j1,j1a = GetWeld(joint1)
  1972. local j2,j2a = GetWeld(joint2)
  1973. local j3,j3a = GetWeld(joint3)
  1974. local j4,j4a = GetWeld(joint4)
  1975. local j5,j5a = GetWeld(joint5)
  1976.  
  1977. local landingpos
  1978.  
  1979. while VWallRunning == "BackflipFromFall" do
  1980. counter2 = counter2 + 1
  1981. local hitz, enz = RAY(H.Position+Vector3.new(0,2,0), Vector3.new(0,-4.4,0))
  1982.  
  1983. if counter2 - counter < 13 then
  1984. bgangleplus = bgangleplus - ((math.pi*1.1)/13)
  1985. end
  1986. if counter2 - counter <= 13 then
  1987. SetWeld(joint1,counter2-counter,13, j1,j1a, Vector3.new(1.4,0.5,0.1), Vector3.new(math.pi/2,0.1,math.pi/2))
  1988. SetWeld(joint2,counter2-counter,13, j2,j2a, Vector3.new(-1.4,0.5,0.1), Vector3.new(math.pi/2,-0.1,-math.pi/2))
  1989. SetWeld(joint3,counter2-counter,13, j3,j3a, Vector3.new(0.52,-0.3,-0.65), Vector3.new(0,math.pi/2,0))
  1990. SetWeld(joint4,counter2-counter,13, j4,j4a, Vector3.new(-0.51,-0.9,-0.05), Vector3.new(0,math.pi/2,0))
  1991. SetWeld(joint5,counter2-counter,13, j5,j5a, Vector3.new(0,0.9,0), Vector3.new(-math.pi/7,0,0))
  1992. end
  1993.  
  1994. dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1995. --bv.velocity = Vector3.new(0,-2,0)
  1996. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1997. if VWRLeft == true then
  1998. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1999. end
  2000. if VWRRight == true then
  2001. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  2002. end
  2003. bg.cframe = CFrame.new(NV, (-towall*30) + Vector3.new(0,GravPoint,0)) * CFrame.Angles((-math.pi/2.4) + bgangleplus,math.pi,0)
  2004.  
  2005. if hitz ~= nil then
  2006. bv:remove()
  2007. landingpos = enz - (towall*1.3)
  2008. if counter2 - counter > 8 then
  2009. bp = Instance.new("BodyPosition", Torsoz)
  2010. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  2011. bp.position = enz+Vector3.new(0,2.4,0) + (-towall*1)
  2012. VWallRunning = "LandingFall"
  2013. else
  2014. Torsoz.CFrame = bg.cframe + (enz+Vector3.new(0,2.3,0))
  2015. Torsoz.Velocity = NV
  2016. Torsoz.RotVelocity = NV
  2017. local bp = Instance.new("BodyPosition", Torsoz)
  2018. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  2019. bp.position = Torsoz.CFrame.p
  2020. game:service("Debris"):AddItem(bp, 0.14)
  2021. flow.Value = 0
  2022. end
  2023. break
  2024. end
  2025.  
  2026. if GravPoint > - 180 then
  2027. GravPoint = GravPoint - 1.9
  2028. end
  2029. if counter2 > 200 then
  2030. break
  2031. end
  2032. wait(0.02)
  2033. end
  2034.  
  2035. if VWallRunning == "LandingFall" then
  2036. print("Landing")
  2037.  
  2038. joint3.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  2039. joint4.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  2040. local j1,j1a = GetWeld(joint1)
  2041. local j2,j2a = GetWeld(joint2)
  2042. local j3,j3a = GetWeld(joint3)
  2043. local j4,j4a = GetWeld(joint4)
  2044. local j5,j5a = GetWeld(joint5)
  2045.  
  2046. local a
  2047. local mesh
  2048. if GravPoint < -70 then
  2049. a = P:Clone()
  2050. a.Parent = Torsoz
  2051. a.Name = "AirLandingEffect"
  2052. a.BrickColor = BrickColor.new("Medium stone grey")
  2053. a.Transparency = 0.3
  2054. a.CFrame = CFrame.new(landingpos+Vector3.new(0,0.4,0))
  2055. mesh = Instance.new("SpecialMesh", a)
  2056. mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  2057. mesh.Scale = Vector3.new(0,0,0)
  2058. end
  2059.  
  2060. local bgcf = CFrame.new(NV, Vector3.new(towall.x,0,towall.z))
  2061. bg.cframe = bgcf * CFrame.Angles(-math.pi/7,0,0)
  2062. local bgval = math.pi/7/2
  2063.  
  2064. for i = 1, 6 do
  2065. Hu.PlatformStand = true
  2066. SetWeld(joint1,i,6, j1,j1a, Vector3.new(1.2,0.5,0.2), Vector3.new(math.pi/2,0.5,math.pi/1.2))
  2067. SetWeld(joint2,i,6, j2,j2a, Vector3.new(-1.2,0.5,0.2), Vector3.new(math.pi/2,-0.5,-math.pi/1.2))
  2068. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.51,-0.3,-0.8), Vector3.new(0,math.pi/2,-math.pi/7))
  2069. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.51,-0.8,-0.7), Vector3.new(0,math.pi/2,-math.pi/3))
  2070. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,0.85,0), Vector3.new(-math.pi/8,0,0))
  2071. bp.position = bp.position + Vector3.new(0,-0.07,0)
  2072. bg.cframe = bgcf * CFrame.Angles((-bgval*2) + (bgval/6*i),0,0)
  2073. Torsoz.CFrame = bg.cframe + bp.position
  2074. if a ~= nil then
  2075. mesh.Scale = mesh.Scale + Vector3.new(1.3,0.35,1.3)
  2076. a.Transparency = 0.3 + (0.7/6*i)
  2077. end
  2078. wait(0.02)
  2079. end
  2080. if a ~= nil then
  2081. a:remove()
  2082. end
  2083. local j1,j1a = GetWeld(joint1)
  2084. local j2,j2a = GetWeld(joint2)
  2085. local j3,j3a = GetWeld(joint3)
  2086. local j4,j4a = GetWeld(joint4)
  2087. local j5,j5a = GetWeld(joint5)
  2088. for i = 1, 6 do
  2089. Hu.PlatformStand = true
  2090. SetWeld(joint1,i,6, j1,j1a, Vector3.new(1.5,0.5,0), Vector3.new(0,0,0))
  2091. SetWeld(joint2,i,6, j2,j2a, Vector3.new(-1.5,0.5,0), Vector3.new(0,0,0))
  2092. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.5,-1,0), Vector3.new(0,math.pi/2,0))
  2093. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.5,-1,0), Vector3.new(0,math.pi/2,0))
  2094. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,1,0), Vector3.new(0,0,0))
  2095. bp.position = bp.position + Vector3.new(0,0.1,0)
  2096. bg.cframe = bgcf * CFrame.Angles(-bgval + (bgval/6*i),0,0)
  2097. Torsoz.CFrame = bg.cframe + bp.position
  2098. wait(0.02)
  2099. end
  2100.  
  2101. bp:remove()
  2102. end
  2103.  
  2104. end
  2105.  
  2106. bv:remove()
  2107. bg:remove()
  2108. VWallRunning = false
  2109. Stand()
  2110. end
  2111. end
  2112.  
  2113. function Slide(pos)
  2114. flow.Value = flow.Value + 6
  2115. Action = "Sliding"
  2116. Sliding = true
  2117. GravPoint = Torsoz.Velocity.y
  2118. local spd = Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude + 10
  2119. local dir = Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).unit
  2120.  
  2121. local bv = Instance.new("BodyVelocity", Torsoz)
  2122. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  2123. bv.velocity = dir*spd
  2124. local bg = Instance.new("BodyGyro", Torsoz)
  2125. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  2126. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles(math.pi/2.2,0.24,0)
  2127.  
  2128. local joint1 = Joint1
  2129. local joint2 = Joint2
  2130. local joint3 = Joint3
  2131. local joint4 = Joint4
  2132. local joint5 = Joint5
  2133. local j1,j1a = GetWeld(joint1)
  2134. local j2,j2a = GetWeld(joint2)
  2135.  
  2136. SetWeld(joint1,1,1, NV,NV, Vector3.new(j1.x,j1.y,j1.z), Vector3.new(j1a.x,math.pi/2,j1a.z))
  2137. joint1.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  2138. SetWeld(joint2,1,1, NV,NV, Vector3.new(j2.x,j2.y,j2.z), Vector3.new(j2a.x,math.pi/2,j2a.z))
  2139. joint2.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  2140.  
  2141. local j1,j1a = GetWeld(joint1)
  2142. local j2,j2a = GetWeld(joint2)
  2143. local j3,j3a = GetWeld(joint3)
  2144. local j4,j4a = GetWeld(joint4)
  2145. local j5,j5a = GetWeld(joint5)
  2146.  
  2147. local count = 0
  2148. local lastpos
  2149.  
  2150. while Sliding == true do
  2151. count = count + 1
  2152. Hu.PlatformStand = true
  2153. local hitz1, enz1 = RAY(Torsoz.Position+Vector3.new(0,0.03,0), dir *2.5)
  2154. local hitz2, enz2 = RAY(Torsoz.Position-Vector3.new(0,0.2,0), dir *2.5)
  2155. local ghitz, genz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  2156. bv.velocity = dir*spd + Vector3.new(0,GravPoint,0)
  2157.  
  2158. if count <= 5 then
  2159. SetWeld(joint1,count,5, j1,j1a, Vector3.new(0.5,-0.8,-0.15), Vector3.new(0,(math.pi/2)+0.1,-0.4))
  2160. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-0.5,-1,0), Vector3.new(0,(math.pi/2)-0.4,0))
  2161. SetWeld(joint3,count,5, j3,j3a, Vector3.new(1.5,0.5,0), Vector3.new(-0.7,-0.24,math.pi/5))
  2162. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-1.5,0.5,0), Vector3.new(-0.1,0,-math.pi/1.5))
  2163. SetWeld(joint5,count,5, j5,j5a, Vector3.new(0,1,0), Vector3.new(-0.5,-0.2,0))
  2164. end
  2165.  
  2166. if (hitz1 ~= nil and hitz1.CanCollide == true) or (hitz2 ~= nil and hitz2.CanCollide == true) then
  2167. bv:remove()
  2168. bg:remove()
  2169. Sliding = "HitObject"
  2170. end
  2171. if ghitz ~= nil then
  2172. GravPoint = 0
  2173. Torsoz.CFrame = CFrame.new(genz, genz+dir) * CFrame.Angles(math.pi/2.2,0.24,0) + Vector3.new(0,0.7,0)
  2174. spd = spd - 0.95
  2175. else
  2176. if GravPoint > -180 then
  2177. GravPoint = GravPoint - 5.6
  2178. end
  2179. spd = spd - 0.36
  2180. end
  2181. if spd < 7 then
  2182. Sliding = false
  2183. end
  2184. wait(0.02)
  2185. end
  2186.  
  2187. if Sliding == false then
  2188. local j1,j1a = GetWeld(joint1)
  2189. local j2,j2a = GetWeld(joint2)
  2190. local j3,j3a = GetWeld(joint3)
  2191. local j4,j4a = GetWeld(joint4)
  2192. local j5,j5a = GetWeld(joint5)
  2193. for i = 1, 4 do
  2194. SetWeld(joint1,i,4, j1,j1a, Vector3.new(0.5,-1,0), Vector3.new(0,math.pi/2,0))
  2195. SetWeld(joint2,i,4, j2,j2a, Vector3.new(-0.5,-1,0), Vector3.new(0,math.pi/2,0))
  2196. SetWeld(joint3,i,4, j3,j3a, Vector3.new(1.5,0.5,0), NV)
  2197. SetWeld(joint4,i,4, j4,j4a, Vector3.new(-1.5,0.5,0), NV)
  2198. SetWeld(joint5,i,4, j5,j5a, Vector3.new(0,1,0), NV)
  2199. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  2200. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles((math.pi/2.2) - ((math.pi/2.2)/4*i),0.24 - (0.24/4*i),0)
  2201. bv.velocity = dir*spd + Vector3.new(0,GravPoint,0)
  2202.  
  2203. if hitz ~= nil then
  2204. GravPoint = 0
  2205. Torsoz.CFrame = CFrame.new(enz, enz+dir) * CFrame.Angles((math.pi/2.2) - ((math.pi/2.2)/4*i),0.24 - (0.24/4*i),0) + Vector3.new(0,0.7+(1.8/4*i),0)
  2206. spd = spd - 0.95
  2207. else
  2208. if GravPoint > -180 then
  2209. GravPoint = GravPoint - 5.6
  2210. end
  2211. spd = spd - 0.36
  2212. end
  2213. wait(0.02)
  2214. end
  2215. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  2216. Torsoz.CFrame = CFrame.new(enz, enz+dir) + Vector3.new(0,3,0)
  2217. end
  2218. bv:remove()
  2219. bg:remove()
  2220. SlideCooldown = 10
  2221. Stand()
  2222. end
  2223.  
  2224. function KD(key)
  2225. if pause.Value == false then
  2226. if key == string.char(32) then
  2227. Space = true
  2228.  
  2229. local ghitz, genz = RAY(Torsoz.Position, Vector3.new(0,-3.7,0))
  2230. local hitz, enz = RAY(Torsoz.Position+Vector3.new(0,1.1,0), Torsoz.CFrame.lookVector*2.3)
  2231. local righthitz, rightenz
  2232. local lefthitz, leftenz
  2233.  
  2234. if HWallRunning == false then
  2235. righthitz, rightenz = RAY(Torsoz.Position, ((Torsoz.CFrame * CFrame.new(1.5,0,-0.2)).p - Torsoz.CFrame.p).unit*3.9)
  2236. lefthitz, leftenz = RAY(Torsoz.Position, ((Torsoz.CFrame * CFrame.new(-1.5,0,-0.2)).p - Torsoz.CFrame.p).unit*3.9)
  2237.  
  2238. elseif HWallRunning == "Jumping" then
  2239. righthitz, rightenz = RAY(Torsoz.Position, ((CFrame.new(Torsoz.Position, Torsoz.Position + HWRDir) * CFrame.new(1.5,0,-0.2)).p - Torsoz.Position).unit*3.9)
  2240. lefthitz, leftenz = RAY(Torsoz.Position, ((CFrame.new(Torsoz.Position, Torsoz.Position + HWRDir) * CFrame.new(-1.5,0,-0.2)).p - Torsoz.Position).unit*3.9)
  2241.  
  2242. end
  2243.  
  2244. if Action == "Standing" and Shift == true and (hitz == nil or hitz.CanCollide == false) and (righthitz == nil or righthitz.CanCollide == false) and (lefthitz == nil or lefthitz.CanCollide == false) and (ghitz == nil or ghitz.CanCollide == false) and (Torsoz.Velocity.y > 6 and Torsoz.Velocity.y < 50) and DivingCooldown <= 0 then
  2245. if stamina >= 10 then
  2246. --if Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude > 12 then
  2247. Dive()
  2248. --end
  2249. end
  2250. end
  2251.  
  2252. if hitz == nil and VWallRunning == "Falling" then
  2253. VWallRunning = "BackflipFromFall"
  2254. end
  2255.  
  2256. if Shift == true and Torsoz.Velocity.y > -50 and Diving == false and DivingCooldown <= 0 then
  2257. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-3.5,0))
  2258.  
  2259. if hitz ~= nil then
  2260. if Action == "Standing" and VWRCooldown == 0 then
  2261. if hitz2 == nil or hitz2.CanCollide == false then
  2262. VWR(hitz, enz)
  2263. end
  2264. end
  2265. end
  2266.  
  2267. if (HWallRunning == false or (HWallRunning == "Jumping" and (HWRLastPart ~= righthitz or HWRLastPart ~= lefthitz))) and HWRCooldown == 0 and VWallRunning == false then
  2268.  
  2269. if (hitz == nil or HWallRunning == "Jumping") and ((righthitz ~= nil and righthitz.Parent:findFirstChild("Humanoid") == nil and righthitz.Parent.className ~= "Hat") or (lefthitz ~= nil and lefthitz.Parent:findFirstChild("Humanoid") == nil and lefthitz.Parent.className ~= "Hat")) then
  2270. if hitz2 == nil or hitz2.CanCollide == false then
  2271. local right = (rightenz - Torsoz.Position).magnitude
  2272. local left = (leftenz - Torsoz.Position).magnitude
  2273. if right < left then
  2274. if HWallRunning == "Jumping" and HWRLastPart ~= righthitz then
  2275. HWallRunning = false
  2276. while Standing == false do
  2277. wait(0.01)
  2278. end
  2279. print("2nd Right Activated!")
  2280. HWallRun(righthitz, rightenz, -math.pi/2)
  2281. else
  2282. if hitz == nil then
  2283. print("Right Activated")
  2284. HWallRun(righthitz, rightenz, -math.pi/2)
  2285. end
  2286. end
  2287. elseif left < right then
  2288. if HWallRunning == "Jumping" and HWRLastPart ~= lefthitz then
  2289. HWallRunning = false
  2290. while Standing == false do
  2291. wait(0.01)
  2292. end
  2293. print("2nd Left Activated!")
  2294. HWallRun(lefthitz, leftenz, math.pi/2)
  2295. else
  2296. if hitz == nil then
  2297. print("Left Activated")
  2298. HWallRun(lefthitz, leftenz, math.pi/2)
  2299. end
  2300. end
  2301. end
  2302. end
  2303. end
  2304. end
  2305.  
  2306. end
  2307.  
  2308. if HWallRunning == true then
  2309. HWallRunning = "Jumping"
  2310. Action = "HWRJumping"
  2311. end
  2312.  
  2313. elseif key == string.char(48) then
  2314. Shift = true
  2315. elseif key == string.char(50) then
  2316. if Action == "Standing" then
  2317. Sit()
  2318. elseif HWallRunning == true then
  2319. HWRGravDrop = true
  2320. end
  2321. elseif key == string.char(52) then
  2322. if Shift == true and Action == "Standing" and SlideCooldown == 0 and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude > 15 and Torsoz.Velocity.y > -40 then
  2323. print("Sliding")
  2324. Slide()
  2325. end
  2326. elseif key == "a" then
  2327. VWRLeft = true
  2328. elseif key == "d" then
  2329. VWRRight = true
  2330. end
  2331. end
  2332. end
  2333.  
  2334. function KU(key)
  2335. if key == string.char(32) then
  2336. Space = false
  2337. elseif key == string.char(48) then
  2338. Shift = false
  2339. elseif key == string.char(50) then
  2340. if Action == "Sitting" then
  2341. Stand()
  2342. end
  2343. elseif key == string.char(52) then
  2344. Sliding = false
  2345. elseif key == "a" then
  2346. VWRLeft = false
  2347. elseif key == "d" then
  2348. VWRRight = false
  2349. end
  2350. end
  2351.  
  2352. mouse.KeyDown:connect(function(key) KD(key) end)
  2353. mouse.KeyUp:connect(function(key) KU(key) end)
  2354.  
  2355. Joint1 = Instance.new("Snap", Torsoz)
  2356. GetWeld(Joint1)
  2357. Joint2 = Instance.new("Snap", Torsoz)
  2358. GetWeld(Joint2)
  2359. Joint3 = Instance.new("Snap", Torsoz)
  2360. GetWeld(Joint3)
  2361. Joint4 = Instance.new("Snap", Torsoz)
  2362. GetWeld(Joint4)
  2363. Joint5 = Instance.new("Snap", Torsoz)
  2364. GetWeld(Joint5)
  2365. Stand()
  2366.  
  2367. local animatebg = Instance.new("BodyGyro")
  2368. animatebg.D = 100
  2369. local GravAction = "Idle"
  2370. local PrevGravAction = GravAction
  2371.  
  2372. local prevrapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  2373. local prevlapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  2374. local hue = 0
  2375. local recyclecount = 0
  2376. local tickoffset = tick()
  2377. local fadetab = {}
  2378. local fadetab2 = {}
  2379. local animatebgcount = 0
  2380.  
  2381. for i = 1, 13 do
  2382. local p = P:Clone()
  2383. p.Name = "Part"..i
  2384. local mesh = Instance.new("SpecialMesh", p)
  2385. mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
  2386. mesh.TextureId = "http://www.roblox.com/Asset/?id=48358980"
  2387. table.insert(fadetab, {p, mesh})
  2388. end
  2389. for i = 1, 13 do
  2390. local p = P:Clone()
  2391. p.Name = "Part"..i
  2392. local mesh = Instance.new("SpecialMesh", p)
  2393. mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
  2394. mesh.TextureId = "http://www.roblox.com/Asset/?id=48358980"
  2395. table.insert(fadetab2, {p, mesh})
  2396. end
  2397.  
  2398. game:service("RunService").Stepped:connect(function()
  2399. GravAction = "Idle"
  2400. hue = hue + 3
  2401. hue = hue % 360
  2402.  
  2403. ------------- anim angle changing --------
  2404. if animangle > math.pi then
  2405. animplus = false
  2406. elseif animangle < -math.pi then
  2407. animplus = true
  2408. end
  2409. if animplus == true then
  2410. animangle = animangle + animspeed
  2411. elseif animplus == false then
  2412. animangle = animangle - animspeed
  2413. end
  2414.  
  2415. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-3.9,0))
  2416. if Shift == true then
  2417. Hu.WalkSpeed = sprint
  2418. else
  2419. Hu.WalkSpeed = 16
  2420. end
  2421. if (FOV >= 70 and FOV < 74) and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude > 25 then
  2422. FOV = FOV + 1
  2423. elseif (FOV <= 74 and FOV > 70) and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 20 then
  2424. FOV = FOV - 1
  2425. end
  2426. if pause.Value == true then
  2427. Hu.WalkSpeed = 0
  2428. end
  2429. if Sitting == true then
  2430. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-2.2,0))
  2431. Hu.PlatformStand = true
  2432. if hitz2 == nil then
  2433. Stand()
  2434. end
  2435. end
  2436. if Diving == true then
  2437. Hu.PlatformStand = true
  2438. DivingBV.velocity = Vector3.new(DivingDir.x*(sprint+2),GravPoint,DivingDir.z*(sprint+2))
  2439. DivingBG.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+DivingBV.velocity) * CFrame.Angles(-math.pi/2,0,0)
  2440.  
  2441. if GravPoint > -180 then
  2442. GravPoint = GravPoint - 2
  2443. end
  2444. end
  2445. if DivingCooldown > 0 then
  2446. DivingCooldown = DivingCooldown - 1
  2447. end
  2448. if HWallRunning == true then
  2449. if HWRGravDrop == false then
  2450. GravPoint = GravPoint - 0.4
  2451. else
  2452. GravPoint = GravPoint - 2
  2453. end
  2454. elseif HWallRunning == "Jumping" then
  2455. GravPoint = GravPoint - 1.7
  2456. end
  2457. ----------------------------- stamina ----------------------------------------
  2458. if Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude > 18 and Action == "Standing" and Shift == true then
  2459. if stamina > 0 then
  2460. stamina = stamina - 0.5
  2461. if stamina < 0 then
  2462. Shift = false
  2463. stamina = 0
  2464. end
  2465. else
  2466. Shift = false
  2467. stamina = 0
  2468. end
  2469. if Action == "Standing" then
  2470. animspeed = 0.85
  2471. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/4.85,0,0))
  2472. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/4.85,0,0))
  2473. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/3.5,0,0))
  2474. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/3.5,0,0))
  2475. end
  2476. elseif Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude > 12 and Action ~= "Sliding" then
  2477. if stamina < maxstamina then
  2478. stamina = stamina + 0.5
  2479. if stamina > maxstamina then
  2480. stamina = maxstamina
  2481. end
  2482. else
  2483. stamina = maxstamina
  2484. end
  2485. if Action == "Standing" then
  2486. animspeed = 0.65
  2487. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/7,0,0))
  2488. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/7,0,0))
  2489. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/5,0,0))
  2490. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/5,0,0))
  2491. end
  2492. elseif Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude < 2 then
  2493. animspeed = 0.1
  2494. if Action == "Standing" then
  2495. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/38,0,0))
  2496. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/38,0,0))
  2497. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/30,0,0))
  2498. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/30,0,0))
  2499. end
  2500. if stamina < maxstamina then
  2501. if Sitting == false then
  2502. stamina = stamina + 0.65
  2503. else
  2504. stamina = stamina + 1.02
  2505. end
  2506. if stamina > maxstamina then
  2507. stamina = maxstamina
  2508. end
  2509. else
  2510. stamina = maxstamina
  2511. end
  2512. end
  2513.  
  2514. if hitz == nil then
  2515. if Torsoz.Velocity.y > 1 or (Torsoz.Velocity.y < -1 and Torsoz.Velocity.y > -90) then
  2516. if Action == "Standing" then
  2517. GravAction = "Rising"
  2518. animspeed = 0.1
  2519. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/38,0,0))
  2520. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/38,0,0))
  2521. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new((math.pi-0.2)+(animangle/30),0,0))
  2522. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new((math.pi-0.2)+(-animangle/30),0,0))
  2523. if animatebg.Parent ~= nil then
  2524. animatebg.Parent = Torsoz
  2525. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  2526. local lokvec = Torsoz.CFrame.lookVector*100
  2527. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z))
  2528. animatebg.Parent = nil
  2529. end
  2530. end
  2531. end
  2532. end
  2533.  
  2534. if hitz == nil then
  2535. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-6,0))
  2536. if hitz2 == nil then
  2537. if Torsoz.Velocity.y < -90 then
  2538. if Action == "Standing" then
  2539. GravAction = "Falling"
  2540. animspeed = 1.1
  2541. animatebg.Parent = Torsoz
  2542. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  2543. local lokvec = Torsoz.CFrame.lookVector*100
  2544. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z)) * CFrame.Angles(-math.pi/11,animangle/70,0)
  2545. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.45,-0.8,0), Vector3.new((animangle/27)-0.3,0,0.18))
  2546. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.45,-0.8,0), Vector3.new((-animangle/27)-0.3,0,-0.18))
  2547. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.4,0.5,0), Vector3.new((math.pi+0.2)+(animangle/26),0,0.18))
  2548. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.4,0.5,0), Vector3.new((math.pi+0.2)+(-animangle/26),0,-0.18))
  2549. end
  2550. end
  2551. elseif hitz2.CanCollide == true then
  2552. if animatebg.Parent ~= nil then
  2553. animatebg.Parent = Torsoz
  2554. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  2555. local lokvec = Torsoz.CFrame.lookVector*100
  2556. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z))
  2557. animatebg.Parent = nil
  2558. end
  2559. end
  2560. end
  2561.  
  2562. if GravAction == "Idle" and animatebg.Parent ~= nil then
  2563. animatebg.Parent = nil
  2564. end
  2565.  
  2566. if math.abs(tickoffset - tick()) > 0.05 then
  2567. tickoffset = tick()
  2568. local flowcolor = HSV(hue, 0.7,1)
  2569. recyclecount = (recyclecount % #fadetab) + 1
  2570. if flow.Value > 25 then
  2571. local lapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  2572. local rapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  2573. local p = fadetab[recyclecount]
  2574. p[1].Parent = m
  2575. p[1].CFrame = CFrame.new((lapos+prevlapos)/2, lapos)
  2576. p[2].Scale = Vector3.new(0.5,0.5,(lapos-prevlapos).magnitude*2)
  2577. p[2].VertexColor = Vector3.new(flowcolor.r,flowcolor.g,flowcolor.b)
  2578. p[1].Transparency = math.abs((flow.Value/120) - 0.8)
  2579. p[1].Transparency = p[1].Transparency + (1/#fadetab)
  2580. local p = fadetab2[recyclecount]
  2581. p[1].Parent = m
  2582. p[1].CFrame = CFrame.new((rapos+prevrapos)/2, rapos)
  2583. p[2].Scale = Vector3.new(0.5,0.5,(rapos-prevrapos).magnitude*2)
  2584. p[2].VertexColor = Vector3.new(flowcolor.r,flowcolor.g,flowcolor.b)
  2585. p[1].Transparency = math.abs((flow.Value/120) - 0.8)
  2586. p[1].Transparency = p[1].Transparency + (1/#fadetab)
  2587. end
  2588.  
  2589. for i, v in pairs(fadetab) do
  2590. if v[1].Transparency < 0.9 then
  2591. v[1].Transparency = v[1].Transparency + (1/#fadetab)
  2592. fadetab2[i][1].Transparency = fadetab2[i][1].Transparency + (1/#fadetab)
  2593. elseif v[1].Transparency ~= 1 then
  2594. v[1].Transparency = 1
  2595. v[1].Position = Vector3.new(50000,0,0)
  2596. fadetab2[i][1].Transparency = 1
  2597. fadetab2[i][1].Position = Vector3.new(50000,0,0)
  2598. end
  2599. end
  2600.  
  2601. prevrapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  2602. prevlapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  2603. end
  2604.  
  2605. if flow.Value > 140 then
  2606. if char.Parent ~= nil then
  2607. char:remove()
  2608. end
  2609. end
  2610.  
  2611. if flowcooldown > 0 then
  2612. flowcooldown = flowcooldown - 1
  2613. end
  2614. if HWRCooldown > 0 then
  2615. HWRCooldown = HWRCooldown - 1
  2616. end
  2617. if VWRCooldown > 0 then
  2618. if hitz ~= nil and VWRCooldown > 0 then
  2619. VWRCooldown = VWRCooldown - 1
  2620. end
  2621. end
  2622. if SlideCooldown > 0 then
  2623. SlideCooldown = SlideCooldown - 1
  2624. end
  2625.  
  2626. if Action == "HWallRunning" or Action == "VWallRunning" then
  2627. flow.Value = flow.Value + 0.24
  2628. if flow.Value > 100 then
  2629. flow.Value = 100
  2630. end
  2631. flowcooldown = 40
  2632. elseif Action == "Diving" then
  2633. flowcooldown = 30
  2634. elseif Action == "Sliding" then
  2635. flowcooldown = 15
  2636. elseif Action == "Standing" or Action == "Sitting" then
  2637. if flow.Value > 0 and flowcooldown <= 0 then
  2638. flow.Value = flow.Value - 0.37
  2639. if flow.Value < 0 then
  2640. flow.Value = 0
  2641. end
  2642. end
  2643. end
  2644.  
  2645. cam.FieldOfView = FOV
  2646. prevanimbgcount = animatebgcount
  2647. sprint = defsprint + ((flow.Value/100)*2.4)
  2648. PrevGravAction = GravAction
  2649. Calculate()
  2650. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement