Advertisement
Sincerate

Parkour Script Remastered

Mar 20th, 2020
6,330
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 62.68 KB | None | 0 0
  1. --[[
  2.     This was orginally developed by: DoogleFox
  3.     And the remastered / edited version by Sincerate#3576
  4.     Roblox:177239
  5. ]]
  6.  
  7. local speed = 55 --You can change this value to whatever you want.
  8. local FOV = 80 --Change the Field of View for you're player, 70 is default.
  9. local Stamina = 6000 --This is the amount of Stamina you will get when you execute the script.
  10. --Just sayin' whatever Field of view you set you will eventually get used to.
  11.  
  12. local player = game:service("Players").LocalPlayer
  13. local mouse = player:GetMouse()
  14. local cam = workspace.CurrentCamera
  15. local char = player.Character
  16. local Torsoz = char:findFirstChild("Torso")
  17. local RA = char:findFirstChild("Right Arm")
  18. local LA = char:findFirstChild("Left Arm")
  19. local RL = char:findFirstChild("Right Leg")
  20. local LL = char:findFirstChild("Left Leg")
  21. local H = char:findFirstChild("Head")
  22. local Hu = char:findFirstChild("Humanoid")
  23. local RS = Torsoz:findFirstChild("Right Shoulder")
  24. local LS = Torsoz:findFirstChild("Left Shoulder")
  25. local RH = Torsoz:findFirstChild("Right Hip")
  26. local LH = Torsoz:findFirstChild("Left Hip")
  27. local N = Torsoz:findFirstChild("Neck")
  28. local NV = Vector3.new(0,0,0)
  29. local FOV = 80
  30. local Shift, Space, Sitting = false,false,false
  31. local GravPoint = 0
  32. local Diving = false
  33. local DivingCooldown = 0
  34. local DivingDir = NV
  35. local DivingCF = CFrame.new(0,0,0)
  36. local DivingBG, DivingBV
  37. local HWallRunning = false
  38. local HWRGravDrop = false
  39. local HWRLastPart
  40. local HWRCooldown = 0
  41. local HWRDir
  42. local VWallRunning = false
  43. local VWRLastPart
  44. local VWRCooldown = 0
  45. local VWRLeft,VWRRight = false,false
  46. local Sliding = false
  47. local SlideCooldown = 0
  48. local Standing = true
  49. local Action = "Standing"
  50. local animplus = true
  51. local animspeed = 0
  52. local animangle = 0.01
  53. local Joint1, Joint2, Joint3, Joint4, Joint5
  54. local sitting = false
  55.  
  56. mouse.KeyDown:connect(function(key)
  57.     if key == "m" then
  58.         if sitting == false then
  59.             sitting = true
  60.                 sitting = Instance.new("Animation", char)
  61.                 print("Sitting!")
  62.         end
  63.     end
  64. end)
  65.  
  66. mouse.KeyUp:connect(function(key)
  67.     if key == "m" then
  68.         if sitting == true then
  69.             sitting = false
  70.             print("Not Sitting Anymore!")
  71.             sitting:Destroy()
  72.         end
  73.     end
  74. end)
  75.  
  76. for i, v in pairs(char:children()) do
  77. 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
  78. v:remove()
  79. end
  80. end
  81.  
  82. local loadids = {112474909, 112474911, 112474909}
  83.  
  84. local stamina = Stamina
  85. local maxstamina = Stamina
  86. local defsprint = speed
  87. local sprint = defsprint  
  88.  
  89. local pause = Instance.new("BoolValue", char)
  90. pause.Name = "Pause"
  91. pause.Value = false
  92. local flow = Instance.new("NumberValue", char)
  93. flow.Name = "Flow"
  94. flow.Value = 0
  95. local flowcooldown = 0
  96.  
  97. local m = Instance.new("Model", char)
  98. m.Name = "FlowChainPartz"
  99.  
  100. local P = Instance.new("Part")
  101. P.Name = "TrailPart"
  102. P.formFactor = "Custom"
  103. P.Size = Vector3.new(0.2,0.2,0.2)
  104. P.Locked = true
  105. P.Anchored = true
  106. P.CanCollide = false
  107. P.TopSurface = 0
  108. P.BottomSurface = 0
  109.  
  110. script.Name = "ParkourSkrip"
  111.  
  112. local hue = 0
  113.  
  114. function HSV(H,S,V)
  115. H = H % 360
  116. local C = V * S
  117. local H2 = H/60
  118. local X = C * (1 - math.abs((H2 %2) -1))
  119. local color = Color3.new(0,0,0)
  120. if H2 <= 0 then
  121. color = Color3.new(C,0,0)
  122. elseif 0 <= H2 and H2 <= 1 then
  123. color = Color3.new(C,X,0)
  124. elseif 1 <= H2 and H2 <= 2 then
  125. color = Color3.new(X,C,0)
  126. elseif 2 <= H2 and H2 <= 3 then
  127. color = Color3.new(0,C,X)
  128. elseif 3 <= H2 and H2 <= 4 then
  129. color = Color3.new(0,X,C)
  130. elseif 4 <= H2 and H2 <= 5 then
  131. color = Color3.new(X,0,C)
  132. elseif 5 <= H2 and H2 <= 6 then
  133. color = Color3.new(C,0,X)
  134. end
  135. local m = V - C
  136. return Color3.new(color.r + m, color.g + m, color.b + m)
  137. end
  138.  
  139. function GetWeld(weld)
  140. if weld:findFirstChild("XAngle") == nil then
  141. local a = Instance.new("NumberValue", weld)
  142. a.Name = "XAngle"
  143. end
  144. if weld:findFirstChild("YAngle") == nil then
  145. local a = Instance.new("NumberValue", weld)
  146. a.Name = "YAngle"
  147. end
  148. if weld:findFirstChild("ZAngle") == nil then
  149. local a = Instance.new("NumberValue", weld)
  150. a.Name = "ZAngle"
  151. end
  152. return weld.C0.p, Vector3.new(weld.XAngle.Value, weld.YAngle.Value, weld.ZAngle.Value)
  153. end
  154.  
  155. function SetWeld(weld, i, loops, origpos,origangle, nextpos,nextangle)
  156. if weld:findFirstChild("XAngle") == nil then
  157. local a = Instance.new("NumberValue", weld)
  158. a.Name = "XAngle"
  159. end
  160. if weld:findFirstChild("YAngle") == nil then
  161. local a = Instance.new("NumberValue", weld)
  162. a.Name = "YAngle"
  163. end
  164. if weld:findFirstChild("ZAngle") == nil then
  165. local a = Instance.new("NumberValue", weld)
  166. a.Name = "ZAngle"
  167. end
  168.  
  169. local tox,toy,toz = 0,0,0
  170. if origangle.x > nextangle.x then
  171. tox = -math.abs(origangle.x - nextangle.x) /loops*i
  172. else
  173. tox = math.abs(origangle.x - nextangle.x) /loops*i
  174. end
  175. if origangle.y > nextangle.y then
  176. toy = -math.abs(origangle.y - nextangle.y) /loops*i
  177. else
  178. toy = math.abs(origangle.y - nextangle.y) /loops*i
  179. end
  180. if origangle.z > nextangle.z then
  181. toz = -math.abs(origangle.z - nextangle.z) /loops*i
  182. else
  183. toz = math.abs(origangle.z - nextangle.z) /loops*i
  184. end
  185.  
  186. local tox2,toy2,toz2 = 0,0,0
  187. if origpos.x > nextpos.x then
  188. tox2 = -math.abs(origpos.x - nextpos.x) /loops*i
  189. else
  190. tox2 = math.abs(origpos.x - nextpos.x) /loops*i
  191. end
  192. if origpos.y > nextpos.y then
  193. toy2 = -math.abs(origpos.y - nextpos.y) /loops*i
  194. else
  195. toy2 = math.abs(origpos.y - nextpos.y) /loops*i
  196. end
  197. if origpos.z > nextpos.z then
  198. toz2 = -math.abs(origpos.z - nextpos.z) /loops*i
  199. else
  200. toz2 = math.abs(origpos.z - nextpos.z) /loops*i
  201. end
  202.  
  203. weld.XAngle.Value = origangle.x + tox
  204. weld.YAngle.Value = origangle.y + toy
  205. weld.ZAngle.Value = origangle.z + toz
  206. weld.C0 = CFrame.new(origpos.x + tox2,origpos.y + toy2,origpos.z + toz2) * CFrame.Angles(origangle.x + tox,origangle.y + toy,origangle.z + toz)
  207. end
  208.  
  209. function LoadTextures()
  210. local pls = game:service("ContentProvider")
  211. for i, v in pairs(loadids) do
  212. pls:Preload("http://www.roblox.com/asset/?id="..v)
  213. wait(0.04)
  214. end
  215. end
  216. LoadTextures()
  217.  
  218. function CreateGui()
  219. for i, v in pairs(player.PlayerGui:children()) do
  220. if v.className == "ScreenGui" and v.Name == "staminaGui" then
  221. v:remove()
  222. end
  223. end
  224. local g = Instance.new("ScreenGui", player.PlayerGui)
  225. g.Name = "staminaGui"
  226.  
  227. local c = Instance.new("Frame", g)
  228. c.Visible = false
  229. c.Size = UDim2.new(0,86,0,320)
  230. c.BackgroundTransparency = 1
  231. c.Position = UDim2.new(1,-96,0.5,-160)
  232. c.Name = "Container"
  233.  
  234. local t = Instance.new("TextLabel", c)
  235. t.Size = UDim2.new(0,0,-0.1,0)
  236. t.Position = UDim2.new(0.3,0,0.5,0)
  237. t.TextXAlignment = "Right"
  238. t.Font = "ArialBold"
  239. t.TextTransparency = 0.1
  240. t.TextColor3 = Color3.new(0,0.6,0.8)
  241. t.TextStrokeColor3 = Color3.new(0,0.2,0.8)
  242. t.TextStrokeTransparency = 0.3
  243. t.FontSize = 6
  244. t.BackgroundTransparency = 1
  245. local t2 = t:Clone()
  246. t2.Parent = c
  247. t2.Size = UDim2.new(0,0,0.1,0)
  248. local l = t:Clone()
  249. l.Parent = c
  250. l.Size = UDim2.new(0,0,0,0)
  251. l.Text = "-----"
  252.  
  253. local f1 = Instance.new("Frame", c)
  254. f1.Name = "Backing"
  255. f1.ClipsDescendants = true
  256. f1.Size = UDim2.new(1,0,0,0)
  257. f1.BackgroundColor3 = Color3.new(0.8,0,0)
  258. f1.BackgroundTransparency = 1
  259. local f1img = Instance.new("ImageLabel", f1)
  260. f1img.BackgroundTransparency = 1
  261. f1img.Image = "http://www.roblox.com/asset/?id=112474909"
  262. f1img.Size = UDim2.new(1,0,0,c.Size.Y.Offset)
  263.  
  264. local f2 = Instance.new("Frame", c)
  265. f2.Name = "Overlay"
  266. f2.ClipsDescendants = true
  267. f2.Size = UDim2.new(1,0,1,0)
  268. f2.BackgroundColor3 = Color3.new(0,0,0.8)
  269. f2.BackgroundTransparency = 1
  270. local f2img = Instance.new("ImageLabel", f2)
  271. f2img.BackgroundTransparency = 1
  272. f2img.Image = "http://www.roblox.com/asset/?id=112474911"
  273. f2img.Size = UDim2.new(1,0,0,c.Size.Y.Offset)
  274.  
  275. function Calculate()
  276. local ysize = c.Size.Y.Offset
  277. local per = (stamina/maxstamina) * c.Size.Y.Offset
  278. local rem = (-(stamina/maxstamina-1)) * c.Size.Y.Offset
  279. f1.Size = UDim2.new(1,0,0,rem)
  280. f2.Size = UDim2.new(1,0,0,per)
  281. f2.Position = UDim2.new(0,0,0,rem)
  282. f2img.Position = UDim2.new(0,0,0,-rem)
  283. t.Text = math.floor(stamina)
  284. t2.Text = maxstamina
  285. end
  286. Calculate()
  287.  
  288. wait(0.01)
  289. c.Visible = true
  290. end
  291. CreateGui()
  292.  
  293. player.CharacterAdded:connect(function()
  294. char = player.Character
  295. Torsoz = char:findFirstChild("Torso")
  296. RA = char:findFirstChild("Right Arm")
  297. LA = char:findFirstChild("Left Arm")
  298. RL = char:findFirstChild("Right Leg")
  299. LL = char:findFirstChild("Left Leg")
  300. H = char:findFirstChild("Head")
  301. Hu = char:findFirstChild("Humanoid")
  302. RS = Torsoz:findFirstChild("Right Shoulder")
  303. LS = Torsoz:findFirstChild("Left Shoulder")
  304. RH = Torsoz:findFirstChild("Right Hip")
  305. LH = Torsoz:findFirstChild("Left Hip")
  306. N = Torsoz:findFirstChild("Neck")
  307. stamina = maxstamina
  308. CreateGui()
  309. end)
  310.  
  311. function RAY(pos, dir, startpos, endpos, distleft, collidedlist)
  312. collidedlist = collidedlist or {char}
  313. startpos = startpos or pos
  314. distleft = distleft or dir.unit * dir.magnitude
  315. endpos = endpos or pos + distleft
  316. local ray = Ray.new(pos, distleft)
  317. local hitz,enz = workspace:FindPartOnRayWithIgnoreList(ray, collidedlist)
  318. --[[
  319. local p = P:Clone()
  320. p.Parent = char
  321. p.Size = Vector3.new(0.4,0.4,0.4)
  322. p.BrickColor = BrickColor.new("Lime green")
  323. p.CanCollide = false
  324. p.CFrame = CFrame.new(enz)
  325. p.Transparency = 0.3
  326. ]]
  327. if hitz ~= nil then
  328. if hitz.CanCollide == false then
  329. table.insert(collidedlist, hitz)
  330. local newpos = enz
  331. local newdistleft = distleft - (dir.unit * (pos - newpos).magnitude)
  332. if newdistleft ~= NV then
  333. return RAY(newpos-(dir*0.01), dir, startpos, endpos, newdistleft+(dir*0.01), collidedlist)
  334. end
  335. end
  336. end
  337.  
  338. return hitz, enz, ray
  339. end
  340.  
  341. function Sit()
  342. Standing = false
  343. local hitz,enz = RAY(Torsoz.Position, Vector3.new(0,-4.1,0))
  344. local tordir = Vector3.new(Torsoz.CFrame.lookVector.x,0,Torsoz.CFrame.lookVector.z)
  345. if (hitz ~= nil and hitz.CanCollide == true) then
  346. 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)
  347. local hitz2,enz2 = RAY(enz+Vector3.new(0,2.25,0), tordir*-2.2)
  348. Hu.PlatformStand = true
  349. Torsoz.CFrame = cf
  350. local bp = Instance.new("BodyPosition", Torsoz)
  351. bp.Name = "StaminaBodyObject"
  352. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  353. bp.D = 100
  354. bp.position = cf.p
  355. local bg = Instance.new("BodyGyro", Torsoz)
  356. bg.Name = "StaminaBodyObject"
  357. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  358. bg.cframe = cf
  359. bg.D = 100
  360. 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))
  361. 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))
  362.  
  363. if hitz2 ~= nil and hitz2.CanCollide == true then
  364. 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)
  365. 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)
  366. Joint5.C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.pi/8.8,0,0)
  367. else
  368. 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))
  369. 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))
  370. SetWeld(Joint5,1,1, NV,NV, Vector3.new(0,1,0), Vector3.new(-math.pi/12,0,0))
  371. end
  372.  
  373. Sitting = true
  374. Action = "Sitting"
  375. end
  376. end
  377.  
  378.  
  379. function Stand()
  380. Hu.PlatformStand = false
  381. if Sitting == true then
  382. local tordir = Torsoz.Position + (Torsoz.CFrame.lookVector*10000)
  383. local cf = CFrame.new(Torsoz.Position + Vector3.new(0,1.8,0), Vector3.new(tordir.x,Torsoz.Position.y,tordir.z))
  384. Torsoz.CFrame = cf
  385. end
  386. for i, v in pairs(Torsoz:children()) do
  387. if v.Name == "StaminaBodyObject" then
  388. v:remove()
  389. end
  390. end
  391. RH.Part0 = nil
  392. LH.Part0 = nil
  393. RS.Part0 = nil
  394. LS.Part0 = nil
  395. Joint1.Part0 = Torsoz
  396. Joint1.Part1 = RL
  397. Joint1.C0 = CFrame.new(0.5,-1,0)
  398. Joint1.C1 = CFrame.new(0,1,0)
  399. Joint2.Part0 = Torsoz
  400. Joint2.Part1 = LL
  401. Joint2.C0 = CFrame.new(-0.5,-1,0)
  402. Joint2.C1 = CFrame.new(0,1,0)
  403. Joint3.Part0 = Torsoz
  404. Joint3.Part1 = RA
  405. Joint3.C0 = CFrame.new(1.5,0.5,0)
  406. Joint3.C1 = CFrame.new(0,0.5,0)
  407. Joint4.Part0 = Torsoz
  408. Joint4.Part1 = LA
  409. Joint4.C0 = CFrame.new(-1.5,0.5,0)
  410. Joint4.C1 = CFrame.new(0,0.5,0)
  411. Joint5.Part0 = Torsoz
  412. Joint5.Part1 = H
  413. Joint5.C0 = CFrame.new(0,1,0)
  414. Joint5.C1 = CFrame.new(0,-0.5,0)
  415. Sitting = false
  416. Diving = false
  417. Standing = true
  418. Action = "Standing"
  419. end
  420.  
  421. --------------------------------------- Dive ----------------------------------
  422.  
  423. function Dive()
  424. stamina = stamina - 10
  425. flow.Value = flow.Value + 10
  426. if flow.Value > 100 then
  427. flow.Value = 100
  428. end
  429. Standing = false
  430. local dir = Vector3.new(Torsoz.CFrame.lookVector.x,0,Torsoz.CFrame.lookVector.z)
  431. GravPoint = 18
  432. DivingDir = dir
  433. local cf = CFrame.new(Torsoz.Position, dir+Vector3.new(0,Torsoz.Position.y,0))
  434. DivingCF = cf
  435. DivingDir = dir
  436. Hu.PlatformStand = true
  437. local bv = Instance.new("BodyVelocity", Torsoz)
  438. bv.Name = "StaminaBodyObject"
  439. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  440. bv.velocity = Vector3.new(DivingDir.x*24,GravPoint,DivingDir.z*24)
  441. DivingBV = bv
  442. local bg = Instance.new("BodyGyro", Torsoz)
  443. bg.Name = "StaminaBodyObject"
  444. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  445. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+bv.velocity) * CFrame.Angles(-math.pi/2,0,0)
  446. bg.D = 100
  447. DivingBG = bg
  448.  
  449. local joint = Joint3
  450. joint.C1 = CFrame.new(0,0.5,0)
  451. local joint2 = Joint4
  452. joint2.C1 = CFrame.new(0,0.5,0)
  453. local joint3 = Joint1
  454. joint3.C1 = CFrame.new(0,1,0)
  455. local joint4 = Joint2
  456. joint4.C1 = CFrame.new(0,1,0)
  457.  
  458. local joint5 = Joint5
  459.  
  460. Diving = true
  461. Action = "Diving"
  462.  
  463. for i = 1, 8 do
  464. 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))
  465. 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))
  466. 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))
  467. 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))
  468. SetWeld(joint5,i,8, Vector3.new(0,1,0), NV, Vector3.new(0,1,0), Vector3.new(0.45,0,0))
  469. wait(0.025)
  470. end
  471.  
  472. local counter = 0
  473. while Diving == true do
  474. counter = counter + 1
  475. bg.Parent = Torsoz
  476. local hitz, enz = RAY(Torsoz.Position, bv.velocity.unit*4.6)
  477. if hitz ~= nil and hitz.CanCollide == true then
  478. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  479. if hitz2 ~= nil then
  480. Diving = "Rolling"
  481. Action = "DiveRolling"
  482. else
  483. Torsoz.CFrame = Torsoz.CFrame * CFrame.new(0,-0.3,0)
  484. Torsoz.Velocity = NV
  485. flow.Value = 0
  486. break
  487. end
  488. end
  489. if counter > 190 then
  490. break
  491. end
  492. wait(0.02)
  493. end
  494.  
  495. bv.velocity = (dir*20) + Vector3.new(0,-0.5,0)
  496.  
  497. local bgcf = bg.cframe
  498. local haslanded = false
  499. local count = 0
  500.  
  501. while haslanded == false do
  502. bg.cframe = bgcf * CFrame.Angles(-0.3*count,0,0)
  503. local hitz, enz = RAY(Torsoz.Position, ((Torsoz.CFrame*CFrame.new(0,-1,0)).p - Torsoz.CFrame.p).unit*1.6)
  504. if hitz ~= nil and hitz.CanCollide == true then
  505. haslanded = true
  506. end
  507. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-3.8,0))
  508. if hitz2 == nil then
  509. Torsoz.Velocity = NV
  510. break
  511. elseif haslanded == true then
  512. local bp = Instance.new("BodyPosition", Torsoz)
  513. bp.Name = "StaminaJumpFix"
  514. bp.maxForce = Vector3.new(0,1/0,0)
  515. bp.P = 7000
  516. bp.position = enz2 + Vector3.new(0,2.8,0)
  517. game:service("Debris"):AddItem(bp, 0.3)
  518. else
  519. bv.velocity = (dir*20) + Vector3.new(0,-(Torsoz.Position - enz2).magnitude*3,0)
  520.  
  521. end
  522. count = count + 1
  523. if count <= 6 then
  524. local i = count
  525. local j1,j1a = GetWeld(joint)
  526. local j2,j2a = GetWeld(joint2)
  527. local j3,j3a = GetWeld(joint3)
  528. local j4,j4a = GetWeld(joint4)
  529. local j5,j5a = GetWeld(joint5)
  530. 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))
  531. 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))
  532. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.51,0.4,-0.6), Vector3.new(-0.1,0,0.05))
  533. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.51,0.4,-0.6), Vector3.new(-0.1,0,-0.05))
  534. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,1,0), Vector3.new(-0.4,0,0))
  535. elseif count >= 50 then
  536. break
  537. end
  538. wait(0.02)
  539. end
  540.  
  541. Torsoz.Velocity = NV
  542.  
  543. Stand()
  544. DivingCooldown = 9
  545. end
  546.  
  547. function FindSurface(part, position)
  548. local obj = part.CFrame:pointToObjectSpace(position)
  549. local siz = part.Size/2
  550. for i,v in pairs(Enum.NormalId:GetEnumItems()) do
  551. local vec = Vector3.FromNormalId(v)
  552. local wvec = part.CFrame:vectorToWorldSpace(vec)
  553. local vz = (obj)/(siz*vec)
  554. 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
  555. return wvec,vec
  556. end
  557. end
  558. if part.className == "WedgePart" then
  559. return part.CFrame:vectorToWorldSpace(Vector3.new(0,0.707,-0.707)), Vector3.new(0,0.707,-0.707)
  560. end
  561. end
  562. --[[
  563.  
  564.  
  565. function HWallRun(part, pos, side)
  566. if (part.className == "Part" and part.Shape == Enum.PartType.Block) or part.className ~= "Part" then
  567. flow.Value = flow.Value + 9
  568. Standing = false
  569. HWallRunning = true
  570. Action = "HWallRunning"
  571. GravPoint = 10
  572. HWRLastPart = part
  573. local dir, dirc = FindSurface(part, pos)
  574. towall = -dir
  575. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  576.  
  577. local bv = Instance.new("BodyVelocity", Torsoz)
  578. bv.Name = "StaminaBodyObject"
  579. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  580. bv.P = 9000
  581. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  582. local bg = Instance.new("BodyGyro", Torsoz)
  583. bg.Name = "StaminaBodyObject"
  584. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  585. bg.cframe = CFrame.new(Torsoz.Position+(towall*-2), Torsoz.Position) * CFrame.Angles(0,-side,-side/4.2)
  586. bg.D = 100
  587.  
  588. local sid = Instance.new("Snap")
  589.  
  590. local joint1 = Joint3
  591. if side == -math.pi/2 then
  592. 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))
  593. else
  594. sid = joint1
  595. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.6,0), Vector3.new(-math.pi/12,0,math.pi/7))
  596. end
  597. local j1c0 = joint1.C0
  598.  
  599. local joint2 = Joint4
  600. if side == math.pi/2 then
  601. 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))
  602. else
  603. sid = joint2
  604. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.6,0), Vector3.new(-math.pi/12,0,-math.pi/7))
  605. end
  606. local j2c0 = joint2.C0
  607.  
  608. local joint3 = Joint1
  609. joint3.C1 = CFrame.new(0,1,0)
  610. if side == -math.pi/2 then
  611. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.38,-0.3), Vector3.new(0,math.pi/2,0.14))
  612. else
  613. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.8,-0.2), Vector3.new(0,math.pi/2,0.2))
  614. end
  615.  
  616. local joint4 = Joint2
  617. joint4.C1 = CFrame.new(0,1,0)
  618. if side == -math.pi/2 then
  619. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.8,-0.2), Vector3.new(0,0,0.2))
  620. else
  621. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.38,-0.3), Vector3.new(0,0,0.14))
  622. end
  623.  
  624. local joint5 = Joint5
  625. SetWeld(joint5,1,1,NV,NV,Vector3.new(0,0.9,0),Vector3.new(0,0,side/7))
  626.  
  627. Torsoz.CFrame = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  628. bg.cframe = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  629.  
  630. local aniangle = 0
  631. local aniplus = true
  632. local aniangle2 = 0
  633. local aniplus2 = true
  634.  
  635. local prevpart = part
  636. HWRLastPart = part
  637. while HWallRunning == true do
  638.  
  639. if aniangle > math.pi then
  640. aniplus = false
  641. elseif aniangle < -math.pi then
  642. aniplus = true  
  643. end
  644. if aniplus == true then
  645. aniangle = aniangle + 0.95
  646. elseif aniplus == false then
  647. aniangle = aniangle - 0.95
  648. end
  649.  
  650. if aniangle2 > math.pi then
  651. aniplus2 = false
  652. elseif aniangle2 < -math.pi then
  653. aniplus2 = true  
  654. end
  655. if aniplus2 == true then
  656. aniangle2 = aniangle2 + 0.23
  657. elseif aniplus2 == false then
  658. aniangle2 = aniangle2 - 0.23
  659. end
  660.  
  661. Hu.PlatformStand = true
  662. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-3,0))
  663. local hitz2, enz2 = RAY(Torsoz.Position, towall*3.4)
  664.  
  665. --- if player ends wall run on ground
  666. if hitz ~= nil and hitz.CanCollide == true then
  667. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  668. local offset = (bg.cframe.p.y+enz2.y) - bg.cframe.p.y
  669. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  670. Torsoz.Velocity = NV
  671. break
  672. end
  673.  
  674. ---- if new wall found --------
  675. if hitz2 ~= nil and hitz2.CanCollide == true then
  676. if hitz2 ~= prevpart then
  677. local direct = CFrame.new(Torsoz.Position, Torsoz.Position+dir) * CFrame.Angles(0,side,0)
  678. local hitz3, enz3 = RAY(Torsoz.Position, (direct * CFrame.Angles(0,-side/2.3,0)).lookVector*4)
  679. if hitz3 ~= nil then
  680. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  681. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  682. dir, dirc = FindSurface(hitz2, enz2)
  683. towall = -dir
  684. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  685. prevpart = hitz2
  686. HWRLastPart = hitz2
  687. else
  688. ---- if player fails to find new wall to run on
  689. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  690. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  691. Torsoz.Velocity = NV
  692. HWRCooldown = 5
  693. break
  694. end
  695. end
  696. --- continue to wall run
  697. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  698. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  699. else
  700. ---- if player ends wall run at end of wall
  701. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  702. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  703. Torsoz.Velocity = NV
  704. HWRCooldown = 5
  705. break
  706. end
  707.  
  708. local hitz3, enz3 = RAY(Torsoz.Position, Torsoz.CFrame.lookVector*2)
  709. if hitz3 ~= nil and hitz3.CanCollide == true then
  710. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  711. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  712. Torsoz.Velocity = NV
  713. HWRCooldown = 5
  714. break
  715. end
  716.  
  717. bv.Parent = Torsoz
  718. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  719. bg.cframe = bg.cframe * CFrame.Angles(aniangle/80,aniangle/80,0)
  720. Torsoz.CFrame = Torsoz.CFrame * CFrame.Angles(aniangle/80,aniangle/80,0)
  721. local j3,j3a = GetWeld(joint3)
  722. local j4,j4a = GetWeld(joint4)
  723. SetWeld(joint3,1,1, j3,j3a, j3,Vector3.new(-0.2+(aniangle/4),0,0))
  724. SetWeld(joint4,1,1, j4,j4a, j4,Vector3.new(-0.2+(-aniangle/4),0,0))
  725. if side == math.pi/2 then
  726. local j1,j1a = GetWeld(joint1)
  727. SetWeld(joint1,1,1, j1,j1a, j1, Vector3.new(0,0,0.8+(aniangle2/14)))
  728. else
  729. local j2,j2a = GetWeld(joint2)
  730. SetWeld(joint2,1,1, j2,j2a, j2, Vector3.new(0,0,-0.8-(aniangle2/14)))
  731. end
  732.  
  733. wait(0.025)
  734. if GravPoint < -100 then
  735. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  736. local offset = math.abs((bg.cframe.p.y+enz2.y) - bg.cframe.p.y)
  737. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  738. break
  739. end
  740.  
  741. end
  742.  
  743. if HWallRunning == "Jumping" then
  744. HWRCooldown = 6
  745. joint1.C1 = CFrame.new(0,0.5,0)
  746.  
  747. joint2.C1 = CFrame.new(0,0.5,0)
  748. if side == -math.pi/2 then
  749. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/3)
  750. else
  751. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/4)
  752. end
  753.  
  754. joint3.C1 = CFrame.new(0,1,0)
  755. if side == -math.pi/2 then
  756. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),-math.pi/4)
  757. else
  758. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),math.pi/4)
  759. end
  760. joint4.MaxVelocity = 10
  761. joint4.DesiredAngle = 0
  762. joint4.C1 = CFrame.new(0,1,0)
  763. if side == -math.pi/2 then
  764. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),math.pi/4)
  765. else
  766. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),-math.pi/4)
  767. end
  768.  
  769. local joint5 = Joint5
  770. joint5.C1 = CFrame.new(0,-0.5,0) * CFrame.Angles(0,side/2.4,0)
  771. joint5.C0 = CFrame.new(0,1,0)
  772.  
  773. local j1,j1a = GetWeld(joint1)
  774. local j2,j2a = GetWeld(joint2)
  775. local j3,j3a = GetWeld(joint3)
  776. local j4,j4a = GetWeld(joint4)
  777. local j5,j5a = GetWeld(joint5)
  778.  
  779. GravPoint = 26
  780. local collidecount = 0
  781. local bgangle = side/2
  782. local count = 1
  783. local dir2 = (CFrame.new(NV, dir) * CFrame.Angles(0,-side/2.4,0)).lookVector
  784. HWRDir = dir2
  785. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  786. while HWallRunning == "Jumping" do
  787. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  788. local hitz2, enz2 = RAY(Torsoz.Position, dir2*1.4)
  789. if hitz ~= nil and hitz.CanCollide == true then
  790. local offset = math.abs(enz.y - Torsoz.CFrame.p.y)
  791. Torsoz.CFrame = CFrame.new(enz+Vector3.new(0,2.9,0), enz+Vector3.new(0,2.9,0)+dir2)
  792. Torsoz.Velocity = NV
  793. break
  794. end
  795.  
  796. if hitz2 ~= nil and hitz2.CanCollide == true then
  797. collidecount = collidecount + 1
  798. if collidecount == 4 then
  799. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir2) * CFrame.new(0,0,0.4)
  800. Torsoz.Velocity = Vector3.new(0,Torsoz.Velocity.y,0)
  801. HWRCooldown = 5
  802. VWRCooldown = 5
  803. wait(0.02)
  804. break
  805. end
  806. end
  807.  
  808. if side/2 > 0 then
  809. if bgangle > 0.2 then
  810. bgangle = bgangle - 0.055
  811. end
  812. else
  813. if bgangle < -0.2 then
  814. bgangle = bgangle + 0.055
  815. end
  816. end
  817.  
  818. if count <= 5 then
  819. if side == -math.pi/2 then
  820. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/4))
  821. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/3))
  822. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  823. joint3.C0 = joint3.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  824. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  825. joint4.C0 = joint4.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  826. else
  827. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/3))
  828. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/4))
  829. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  830. joint3.C0 = joint3.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  831. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  832. joint4.C0 = joint4.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  833. end
  834.  
  835. count = count + 1
  836. end
  837.  
  838. bg.Parent = Torsoz
  839. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles(0,side/15,-bgangle)
  840. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  841. if collidecount ~= 0 then
  842. bv.velocity = Vector3.new(0,bv.velocity.y,0)
  843. end
  844. if GravPoint < -120 then
  845. break
  846. end
  847. wait(0.025)
  848. end
  849. end
  850.  ]]
  851.  
  852.  
  853. function HWallRun(part, pos, side)
  854. if (part.className == "Part" and part.Shape == Enum.PartType.Block) or part.className ~= "Part" then
  855. flow.Value = flow.Value + 9
  856. Standing = false
  857. HWallRunning = true
  858. Action = "HWallRunning"
  859. GravPoint = 10
  860. HWRLastPart = part
  861. local dir, dirc = FindSurface(part, pos)
  862. towall = -dir
  863. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  864.  
  865. local bv = Instance.new("BodyVelocity", Torsoz)
  866. bv.Name = "StaminaBodyObject"
  867. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  868. bv.P = 9000
  869. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  870. local bg = Instance.new("BodyGyro", Torsoz)
  871. bg.Name = "StaminaBodyObject"
  872. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  873. bg.cframe = CFrame.new(Torsoz.Position+(towall*-2), Torsoz.Position) * CFrame.Angles(0,-side,-side/4.2)
  874. bg.D = 100
  875.  
  876. local sid = Instance.new("Snap")
  877.  
  878. local joint1 = Joint3
  879. if side == -math.pi/2 then
  880. 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))
  881. else
  882. sid = joint1
  883. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.6,0), Vector3.new(-math.pi/12,0,math.pi/7))
  884. end
  885. local j1c0 = joint1.C0
  886.  
  887. local joint2 = Joint4
  888. if side == math.pi/2 then
  889. 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))
  890. else
  891. sid = joint2
  892. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.6,0), Vector3.new(-math.pi/12,0,-math.pi/7))
  893. end
  894. local j2c0 = joint2.C0
  895.  
  896. local joint3 = Joint1
  897. joint3.C1 = CFrame.new(0,1,0)
  898. if side == -math.pi/2 then
  899. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.38,-0.3), Vector3.new(0,math.pi/2,0.14))
  900. else
  901. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.5,-0.8,-0.2), Vector3.new(0,math.pi/2,0.2))
  902. end
  903.  
  904. local joint4 = Joint2
  905. joint4.C1 = CFrame.new(0,1,0)
  906. if side == -math.pi/2 then
  907. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.8,-0.2), Vector3.new(0,0,0.2))
  908. else
  909. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.5,-0.38,-0.3), Vector3.new(0,0,0.14))
  910. end
  911.  
  912. local joint5 = Joint5
  913. SetWeld(joint5,1,1,NV,NV,Vector3.new(0,0.9,0),Vector3.new(0,0,side/7))
  914.  
  915. Torsoz.CFrame = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  916. bg.cframe = CFrame.new(pos+(towall*-2), pos) * CFrame.Angles(0,-side,-side/2.2)
  917.  
  918. local aniangle = 0
  919. local aniplus = true
  920. local aniangle2 = 0
  921. local aniplus2 = true
  922.  
  923. local prevpart = part
  924. HWRLastPart = part
  925. while HWallRunning == true do
  926.  
  927. if aniangle > math.pi then
  928. aniplus = false
  929. elseif aniangle < -math.pi then
  930. aniplus = true  
  931. end
  932. if aniplus == true then
  933. aniangle = aniangle + 0.95
  934. elseif aniplus == false then
  935. aniangle = aniangle - 0.95
  936. end
  937.  
  938. if aniangle2 > math.pi then
  939. aniplus2 = false
  940. elseif aniangle2 < -math.pi then
  941. aniplus2 = true  
  942. end
  943. if aniplus2 == true then
  944. aniangle2 = aniangle2 + 0.23
  945. elseif aniplus2 == false then
  946. aniangle2 = aniangle2 - 0.23
  947. end
  948.  
  949. Hu.PlatformStand = true
  950. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-3,0))
  951. local hitz2, enz2 = RAY(Torsoz.Position, towall*3.4)
  952.  
  953. --- if player ends wall run on ground
  954. if hitz ~= nil and hitz.CanCollide == true then
  955. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  956. local offset = (bg.cframe.p.y+enz2.y) - bg.cframe.p.y
  957. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  958. Torsoz.Velocity = NV
  959. break
  960. end
  961.  
  962. ---- if new wall found --------
  963. if hitz2 ~= nil and hitz2.CanCollide == true then
  964. if hitz2 ~= prevpart then
  965. local direct = CFrame.new(Torsoz.Position, Torsoz.Position+dir) * CFrame.Angles(0,side,0)
  966. local hitz3, enz3 = RAY(Torsoz.Position, (direct * CFrame.Angles(0,-side/2.3,0)).lookVector*4)
  967. if hitz3 ~= nil then
  968. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  969. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side*1.1,-side/2.2)
  970. dir, dirc = FindSurface(hitz2, enz2)
  971. towall = -dir
  972. dir = (CFrame.new(NV, dir) * CFrame.Angles(0,side,0)).lookVector
  973. prevpart = hitz2
  974. HWRLastPart = hitz2
  975. else
  976. ---- if player fails to find new wall to run on
  977. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  978. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  979. Torsoz.Velocity = NV
  980. HWRCooldown = 8
  981. break
  982. end
  983. end
  984. --- continue to wall run
  985. Torsoz.CFrame = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  986. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,-side/2.2)
  987. else
  988. ---- if player ends wall run at end of wall
  989. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  990. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  991. Torsoz.Velocity = NV
  992. HWRCooldown = 8
  993. break
  994. end
  995.  
  996. local hitz3, enz3 = RAY(Torsoz.Position, Torsoz.CFrame.lookVector*2)
  997. if hitz3 ~= nil and hitz3.CanCollide == true then
  998. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  999. bg.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+dir)
  1000. Torsoz.Velocity = NV
  1001. HWRCooldown = 8
  1002. break
  1003. end
  1004.  
  1005. bv.Parent = Torsoz
  1006. bv.velocity = (dir*(sprint-0.5)) + Vector3.new(0,GravPoint,0)
  1007. bg.cframe = bg.cframe * CFrame.Angles(aniangle/80,aniangle/80,0)
  1008. Torsoz.CFrame = Torsoz.CFrame * CFrame.Angles(aniangle/80,aniangle/80,0)
  1009. local j3,j3a = GetWeld(joint3)
  1010. local j4,j4a = GetWeld(joint4)
  1011. SetWeld(joint3,1,1, j3,j3a, j3,Vector3.new(-0.2+(aniangle/4),0,0))
  1012. SetWeld(joint4,1,1, j4,j4a, j4,Vector3.new(-0.2+(-aniangle/4),0,0))
  1013. if side == math.pi/2 then
  1014. local j1,j1a = GetWeld(joint1)
  1015. SetWeld(joint1,1,1, j1,j1a, j1, Vector3.new(0,0,0.8+(aniangle2/14)))
  1016. else
  1017. local j2,j2a = GetWeld(joint2)
  1018. SetWeld(joint2,1,1, j2,j2a, j2, Vector3.new(0,0,-0.8-(aniangle2/14)))
  1019. end
  1020.  
  1021. wait(0.025)
  1022. if GravPoint < -100 then
  1023. bg.cframe = CFrame.new(enz2+(towall*-2), enz2) * CFrame.Angles(0,-side,0)
  1024. local offset = math.abs((bg.cframe.p.y+enz2.y) - bg.cframe.p.y)
  1025. Torsoz.CFrame = CFrame.new(Vector3.new(bg.cframe.p.x,offset,bg.cframe.p.z), enz2) * CFrame.Angles(0,-side,0)
  1026. break
  1027. end
  1028.  
  1029. end
  1030.  
  1031. if HWallRunning == "Jumping" then
  1032. HWRCooldown = 6
  1033. joint1.C1 = CFrame.new(0,0.5,0)
  1034.  
  1035. joint2.C1 = CFrame.new(0,0.5,0)
  1036. if side == -math.pi/2 then
  1037. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/3)
  1038. else
  1039. joint2.C0 = CFrame.new(-1.35,0.5,0) * CFrame.Angles(0,side/2.4,-math.pi/4)
  1040. end
  1041.  
  1042. joint3.C1 = CFrame.new(0,1,0)
  1043. if side == -math.pi/2 then
  1044. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),-math.pi/4)
  1045. else
  1046. joint3.C0 = CFrame.new(0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),math.pi/4)
  1047. end
  1048. joint4.C1 = CFrame.new(0,1,0)
  1049. if side == -math.pi/2 then
  1050. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,math.pi+(side/2.4),math.pi/4)
  1051. else
  1052. joint4.C0 = CFrame.new(-0.5,-0.8,0) * CFrame.Angles(0,(side/2.4),-math.pi/4)
  1053. end
  1054.  
  1055. local joint5 = Joint5
  1056. joint5.C1 = CFrame.new(0,-0.5,0) * CFrame.Angles(0,side/2.4,0)
  1057. joint5.C0 = CFrame.new(0,1,0)
  1058.  
  1059. local j1,j1a = GetWeld(joint1)
  1060. local j2,j2a = GetWeld(joint2)
  1061. local j3,j3a = GetWeld(joint3)
  1062. local j4,j4a = GetWeld(joint4)
  1063. local j5,j5a = GetWeld(joint5)
  1064.  
  1065. GravPoint = 26
  1066. local collidecount = 0
  1067. local bgangle = side/2
  1068. local count = 1
  1069. local dir2 = (CFrame.new(NV, dir) * CFrame.Angles(0,-side/2.4,0)).lookVector
  1070. HWRDir = dir2
  1071. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  1072. while HWallRunning == "Jumping" do
  1073. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-4,0))
  1074. local hitz2, enz2 = RAY(Torsoz.Position, dir2*1.4)
  1075. if hitz ~= nil and hitz.CanCollide == true then
  1076. local offset = math.abs(enz.y - Torsoz.CFrame.p.y)
  1077. Torsoz.CFrame = CFrame.new(enz+Vector3.new(0,2.9,0), enz+Vector3.new(0,2.9,0)+dir2)
  1078. Torsoz.Velocity = NV
  1079. break
  1080. end
  1081.  
  1082. if hitz2 ~= nil and hitz2.CanCollide == true then
  1083. collidecount = collidecount + 1
  1084. if collidecount == 4 then
  1085. Torsoz.CFrame = CFrame.new(Torsoz.Position, Torsoz.Position+dir2) * CFrame.new(0,0,0.4)
  1086. Torsoz.Velocity = Vector3.new(0,Torsoz.Velocity.y,0)
  1087. HWRCooldown = 5
  1088. VWRCooldown = 5
  1089. wait(0.02)
  1090. break
  1091. end
  1092. end
  1093.  
  1094. if side/2 > 0 then
  1095. if bgangle > 0.2 then
  1096. bgangle = bgangle - 0.055
  1097. end
  1098. else
  1099. if bgangle < -0.2 then
  1100. bgangle = bgangle + 0.055
  1101. end
  1102. end
  1103.  
  1104. if count <= 5 then
  1105. if side == -math.pi/2 then
  1106. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/4))
  1107. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/3))
  1108. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1109. joint3.C0 = joint3.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  1110. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1111. joint4.C0 = joint4.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  1112. else
  1113. SetWeld(joint1,count,5, j1,j1a, Vector3.new(1.35,0.5,0), Vector3.new(0,side/2.4,math.pi/3))
  1114. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-1.35,0.5,0), Vector3.new(0,side/2.4,-math.pi/4))
  1115. SetWeld(joint3,count,5, j3,j3a, Vector3.new(0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1116. joint3.C0 = joint3.C0 * CFrame.Angles((math.pi/4)/5*count,0,0)
  1117. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-0.5,-0.8,0), Vector3.new(0,-side/1.7,0))
  1118. joint4.C0 = joint4.C0 * CFrame.Angles((-math.pi/4)/5*count,0,0)
  1119. end
  1120.  
  1121. count = count + 1
  1122. end
  1123.  
  1124. bg.Parent = Torsoz
  1125. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles(0,side/15,-bgangle)
  1126. bv.velocity = (dir2*(sprint+5)) + Vector3.new(0,GravPoint,0)
  1127. if collidecount ~= 0 then
  1128. bv.velocity = Vector3.new(0,bv.velocity.y,0)
  1129. end
  1130. if GravPoint < -120 then
  1131. break
  1132. end
  1133. wait(0.025)
  1134. end
  1135. end
  1136.  
  1137. Hu.PlatformStand = false
  1138. bv:remove()
  1139.  
  1140. HWRGravDrop = false
  1141. Stand()
  1142. HWallRunning = false
  1143. end
  1144. end
  1145.  
  1146. function VWR(part, pos)
  1147. if (part.className == "Part" and part.Shape == Enum.PartType.Block) or part.className ~= "Part" then
  1148. print("VWR Activated")
  1149. flow.Value = flow.Value + 9
  1150. Standing = false
  1151. VWallRunning = true
  1152. Action = "VWallRunning"
  1153. GravPoint = 0
  1154. local percent = 1
  1155. VWRLastPart = part
  1156. local dir, dirc = FindSurface(part, pos)
  1157. towall = -dir
  1158. dir = (CFrame.new(NV, -dir) * CFrame.Angles(math.pi/2,0,0)).lookVector
  1159. --[[
  1160. local p = P:Clone()
  1161. p.Parent = char
  1162. p.Size = Vector3.new(2,2,2)
  1163. p.BrickColor = BrickColor.new("Lime green")
  1164. p.CanCollide = false
  1165. p.CFrame = part.CFrame * CFrame.new(dirc*5)
  1166. p.Transparency = 0.3
  1167. ]]
  1168. local bv = Instance.new("BodyVelocity", Torsoz)
  1169. bv.Name = "StaminaBodyObject"
  1170. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  1171. bv.P = 9000
  1172. bv.velocity = (dir*(sprint-1))*percent
  1173.  
  1174. local bg = Instance.new("BodyGyro", Torsoz)
  1175. bg.Name = "StaminaBodyObject"
  1176. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1177. bg.D = 100
  1178. local posi = pos + (-towall*1.8)
  1179. bg.cframe = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0)
  1180. Torsoz.CFrame = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0)
  1181.  
  1182. local joint1 = Joint3
  1183. SetWeld(joint1,1,1, NV,NV, Vector3.new(1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,0,math.pi/8))
  1184.  
  1185. local joint2 = Joint4
  1186. SetWeld(joint2,1,1, NV,NV, Vector3.new(-1.4,0.45,-0.1), Vector3.new(-math.pi/3.2,0,-math.pi/8))
  1187.  
  1188. local joint3 = Joint1
  1189. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.48,-0.6,-0.1), Vector3.new(0,math.pi/2,0))
  1190. joint3.C1 = CFrame.new(0,0.7,0.2) * CFrame.Angles(0,math.pi/2,0)
  1191.  
  1192. local joint4 = Joint2
  1193. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.48,-0.6,-0.1), Vector3.new(0,math.pi/2,0))
  1194. joint4.C1 = CFrame.new(0,0.7,0.2) * CFrame.Angles(0,math.pi/2,0)
  1195.  
  1196. local joint5 = Joint5
  1197. SetWeld(joint5,1,1, NV,NV, Vector3.new(0,1,0), Vector3.new(math.pi/20,0,0))
  1198.  
  1199. local aniangle = 0
  1200. local aniplus = true
  1201.  
  1202. while VWallRunning == true do
  1203. local hitz, enz = RAY(Torsoz.Position, towall*2.1)
  1204. local hitz2, enz2 = RAY(Torsoz.Position, (CFrame.new(NV,towall)*CFrame.Angles(math.pi/2,0,0)).lookVector*2.4)
  1205.  
  1206. if aniangle > math.pi then
  1207. aniplus = false
  1208. elseif aniangle < -math.pi then
  1209. aniplus = true  
  1210. end
  1211. if aniplus == true then
  1212. aniangle = aniangle + (1.3*(percent+0.2))
  1213. elseif aniplus == false then
  1214. aniangle = aniangle - (1.3*(percent+0.2))
  1215. end
  1216.  
  1217. bv.velocity = (dir*(sprint-1))*percent
  1218. if VWRLeft == true then
  1219. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * (11*percent+5))
  1220. end
  1221. if VWRRight == true then
  1222. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * (11*percent+5))
  1223. end
  1224.  
  1225. bg.cframe = CFrame.new(posi, posi+towall) * CFrame.Angles((math.pi/5),0,0) * CFrame.Angles(0,aniangle/60,0)
  1226.  
  1227. 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)))
  1228. 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)))
  1229. SetWeld(joint3,1,1, NV,NV, Vector3.new(0.51,-0.75,-(aniangle/30)), Vector3.new(0,math.pi/2,(aniangle/8)-0.3))
  1230. SetWeld(joint4,1,1, NV,NV, Vector3.new(-0.51,-0.75,(aniangle/30)), Vector3.new(0,math.pi/2,(-aniangle/8)-0.3))
  1231.  
  1232. if hitz == nil then
  1233. local lv = Torsoz.Position + (Torsoz.CFrame.lookVector*100)
  1234. Torsoz.CFrame = CFrame.new(Torsoz.Position, Vector3.new(lv.x,Torsoz.Position.y,lv.z))
  1235. break
  1236. end
  1237.  
  1238. if hitz2 ~= nil then
  1239. percent = 0
  1240. VWallRunning = "Falling"
  1241. Action = "VWRFalling"
  1242. GravPoint = -7
  1243. break
  1244. end
  1245.  
  1246. wait(0.02)
  1247. percent = percent - 0.028
  1248. if percent <= 0.15 then
  1249. VWallRunning = "Falling"
  1250. Action = "VWRFalling"
  1251. end
  1252. end
  1253.  
  1254. -------------------------- Falling from VWR ------------------------------
  1255. if VWallRunning == "Falling" then
  1256. GravPoint = GravPoint - 1
  1257. local dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1258. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1259.  
  1260. local j1,j1a = GetWeld(joint1)
  1261. local j2,j2a = GetWeld(joint2)
  1262. local j3,j3a = GetWeld(joint3)
  1263. local j4,j4a = GetWeld(joint4)
  1264. local j5,j5a = GetWeld(joint5)
  1265.  
  1266. local counter = 0
  1267. while VWallRunning == "Falling" do
  1268. counter = counter + 1
  1269. local hitz, enz = RAY(H.Position, Vector3.new(0,-2.4,0))
  1270.  
  1271. dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1272. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1273. if VWRLeft == true then
  1274. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1275. end
  1276. if VWRRight == true then
  1277. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1278. end
  1279. bg.cframe = CFrame.new(NV, (-towall*30) + Vector3.new(0,GravPoint,0)) * CFrame.Angles(-math.pi/2.55,math.pi,0)
  1280.  
  1281. if counter <= 35 then
  1282. SetWeld(joint1,counter,35, j1,j1a, Vector3.new(1.4,0.45,-0.1), Vector3.new(math.pi/9,0,math.pi/9))
  1283. SetWeld(joint2,counter,35, j2,j2a, Vector3.new(-1.4,0.45,-0.1), Vector3.new(math.pi/9,0,-math.pi/9))
  1284. SetWeld(joint3,counter,35, j3,j3a, Vector3.new(0.5,-0.75,0), Vector3.new(0,math.pi/2,math.pi/9))
  1285. joint3.C1 = CFrame.new(0,0.7 + (0.3/35*counter),0.2 - (0.2/35*counter)) * CFrame.Angles(0,math.pi/2,0)
  1286. SetWeld(joint4,counter,35, j4,j4a, Vector3.new(-0.5,-0.75,0), Vector3.new(0,math.pi/2,math.pi/9))
  1287. joint4.C1 = CFrame.new(0,0.7 + (0.3/35*counter),0.2 - (0.2/35*counter)) * CFrame.Angles(0,math.pi/2,0)
  1288. SetWeld(joint5,counter,35, j5,j5a, Vector3.new(0,1,0), Vector3.new(-math.pi/6,0,0))
  1289. end
  1290.  
  1291. if hitz ~= nil then
  1292. bv:remove()
  1293. 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)
  1294. Torsoz.Velocity = NV
  1295. Torsoz.RotVelocity = NV
  1296. local bp = Instance.new("BodyPosition", Torsoz)
  1297. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  1298. bp.position = Torsoz.CFrame.p
  1299. game:service("Debris"):AddItem(bp, 0.16)
  1300. flow.Value = 0
  1301. break
  1302. end
  1303.  
  1304. if GravPoint > - 180 then
  1305. GravPoint = GravPoint - 1.9
  1306. end
  1307. if counter > 200 then
  1308. break
  1309. end
  1310. wait(0.02)
  1311. end
  1312.  
  1313. local bp = Instance.new("BodyPosition")
  1314.  
  1315. local counter2 = counter
  1316. local bgangleplus = 0
  1317.  
  1318. local j1,j1a = GetWeld(joint1)
  1319. local j2,j2a = GetWeld(joint2)
  1320. local j3,j3a = GetWeld(joint3)
  1321. local j4,j4a = GetWeld(joint4)
  1322. local j5,j5a = GetWeld(joint5)
  1323.  
  1324. local landingpos
  1325.  
  1326. while VWallRunning == "BackflipFromFall" do
  1327. counter2 = counter2 + 1
  1328. local hitz, enz = RAY(H.Position+Vector3.new(0,2,0), Vector3.new(0,-4.4,0))
  1329.  
  1330. if counter2 - counter < 13 then
  1331. bgangleplus = bgangleplus - ((math.pi*1.1)/13)
  1332. end
  1333. if counter2 - counter <= 13 then
  1334. 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))
  1335. 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))
  1336. SetWeld(joint3,counter2-counter,13, j3,j3a, Vector3.new(0.52,-0.3,-0.65), Vector3.new(0,math.pi/2,0))
  1337. SetWeld(joint4,counter2-counter,13, j4,j4a, Vector3.new(-0.51,-0.9,-0.05), Vector3.new(0,math.pi/2,0))
  1338. SetWeld(joint5,counter2-counter,13, j5,j5a, Vector3.new(0,0.9,0), Vector3.new(-math.pi/7,0,0))
  1339. end
  1340.  
  1341. dirpos = (-towall *5) + Vector3.new(0,GravPoint,0)
  1342. --bv.velocity = Vector3.new(0,-2,0)
  1343. bv.velocity = CFrame.new(NV, dirpos).lookVector * dirpos.magnitude
  1344. if VWRLeft == true then
  1345. bv.velocity = bv.velocity + ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1346. end
  1347. if VWRRight == true then
  1348. bv.velocity = bv.velocity - ((CFrame.new(NV, towall) * CFrame.Angles(0,math.pi/2,0)).lookVector * 9)
  1349. end
  1350. bg.cframe = CFrame.new(NV, (-towall*30) + Vector3.new(0,GravPoint,0)) * CFrame.Angles((-math.pi/2.4) + bgangleplus,math.pi,0)
  1351.  
  1352. if hitz ~= nil then
  1353. bv:remove()
  1354. landingpos = enz - (towall*1.3)
  1355. if counter2 - counter > 8 then
  1356. bp = Instance.new("BodyPosition", Torsoz)
  1357. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  1358. bp.position = enz+Vector3.new(0,2.4,0) + (-towall*1)
  1359. VWallRunning = "LandingFall"
  1360. else
  1361. Torsoz.CFrame = bg.cframe + (enz+Vector3.new(0,2.3,0))
  1362. Torsoz.Velocity = NV
  1363. Torsoz.RotVelocity = NV
  1364. local bp = Instance.new("BodyPosition", Torsoz)
  1365. bp.maxForce = Vector3.new(1/0,1/0,1/0)
  1366. bp.position = Torsoz.CFrame.p
  1367. game:service("Debris"):AddItem(bp, 0.14)
  1368. flow.Value = 0
  1369. end
  1370. break
  1371. end
  1372.  
  1373. if GravPoint > - 180 then
  1374. GravPoint = GravPoint - 1.9
  1375. end
  1376. if counter2 > 200 then
  1377. break
  1378. end
  1379. wait(0.02)
  1380. end
  1381.  
  1382. if VWallRunning == "LandingFall" then
  1383. print("Landing")
  1384.  
  1385. joint3.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  1386. joint4.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  1387. local j1,j1a = GetWeld(joint1)
  1388. local j2,j2a = GetWeld(joint2)
  1389. local j3,j3a = GetWeld(joint3)
  1390. local j4,j4a = GetWeld(joint4)
  1391. local j5,j5a = GetWeld(joint5)
  1392.  
  1393. local a
  1394. local mesh
  1395. if GravPoint < -70 then
  1396. a = P:Clone()
  1397. a.Parent = Torsoz
  1398. a.Name = "AirLandingEffect"
  1399. a.BrickColor = BrickColor.new("Medium stone grey")
  1400. a.Transparency = 0.3
  1401. a.CFrame = CFrame.new(landingpos+Vector3.new(0,0.4,0))
  1402. mesh = Instance.new("SpecialMesh", a)
  1403. mesh.MeshId = "http://www.roblox.com/asset/?id=20329976"
  1404. mesh.Scale = Vector3.new(0,0,0)
  1405. end
  1406.  
  1407. local bgcf = CFrame.new(NV, Vector3.new(towall.x,0,towall.z))
  1408. bg.cframe = bgcf * CFrame.Angles(-math.pi/7,0,0)
  1409. local bgval = math.pi/7/2
  1410.  
  1411. for i = 1, 6 do
  1412. Hu.PlatformStand = true
  1413. 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))
  1414. 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))
  1415. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.51,-0.3,-0.8), Vector3.new(0,math.pi/2,-math.pi/7))
  1416. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.51,-0.8,-0.7), Vector3.new(0,math.pi/2,-math.pi/3))
  1417. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,0.85,0), Vector3.new(-math.pi/8,0,0))
  1418. bp.position = bp.position + Vector3.new(0,-0.07,0)
  1419. bg.cframe = bgcf * CFrame.Angles((-bgval*2) + (bgval/6*i),0,0)
  1420. Torsoz.CFrame = bg.cframe + bp.position
  1421. if a ~= nil then
  1422. mesh.Scale = mesh.Scale + Vector3.new(1.3,0.35,1.3)
  1423. a.Transparency = 0.3 + (0.7/6*i)
  1424. end
  1425. wait(0.02)
  1426. end
  1427. if a ~= nil then
  1428. a:remove()
  1429. end
  1430. local j1,j1a = GetWeld(joint1)
  1431. local j2,j2a = GetWeld(joint2)
  1432. local j3,j3a = GetWeld(joint3)
  1433. local j4,j4a = GetWeld(joint4)
  1434. local j5,j5a = GetWeld(joint5)
  1435. for i = 1, 6 do
  1436. Hu.PlatformStand = true
  1437. SetWeld(joint1,i,6, j1,j1a, Vector3.new(1.5,0.5,0), Vector3.new(0,0,0))
  1438. SetWeld(joint2,i,6, j2,j2a, Vector3.new(-1.5,0.5,0), Vector3.new(0,0,0))
  1439. SetWeld(joint3,i,6, j3,j3a, Vector3.new(0.5,-1,0), Vector3.new(0,math.pi/2,0))
  1440. SetWeld(joint4,i,6, j4,j4a, Vector3.new(-0.5,-1,0), Vector3.new(0,math.pi/2,0))
  1441. SetWeld(joint5,i,6, j5,j5a, Vector3.new(0,1,0), Vector3.new(0,0,0))
  1442. bp.position = bp.position + Vector3.new(0,0.1,0)
  1443. bg.cframe = bgcf * CFrame.Angles(-bgval + (bgval/6*i),0,0)
  1444. Torsoz.CFrame = bg.cframe + bp.position
  1445. wait(0.02)
  1446. end
  1447.  
  1448. bp:remove()
  1449. end
  1450.  
  1451. end
  1452.  
  1453. bv:remove()
  1454. bg:remove()
  1455. VWallRunning = false
  1456. Stand()
  1457. end
  1458. end
  1459.  
  1460. function Slide(pos)
  1461. flow.Value = flow.Value + 6
  1462. Action = "Sliding"
  1463. Sliding = true
  1464. GravPoint = Torsoz.Velocity.y
  1465. local spd = Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude + 10
  1466. local dir = Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).unit
  1467.  
  1468. local bv = Instance.new("BodyVelocity", Torsoz)
  1469. bv.maxForce = Vector3.new(1/0,1/0,1/0)
  1470. bv.velocity = dir*spd
  1471. local bg = Instance.new("BodyGyro", Torsoz)
  1472. bg.maxTorque = Vector3.new(1/0,1/0,1/0)
  1473. bg.cframe = CFrame.new(NV, dir) * CFrame.Angles(math.pi/2.2,0.24,0)
  1474.  
  1475. local joint1 = Joint1
  1476. local joint2 = Joint2
  1477. local joint3 = Joint3
  1478. local joint4 = Joint4
  1479. local joint5 = Joint5
  1480. local j1,j1a = GetWeld(joint1)
  1481. local j2,j2a = GetWeld(joint2)
  1482.  
  1483. SetWeld(joint1,1,1, NV,NV, Vector3.new(j1.x,j1.y,j1.z), Vector3.new(j1a.x,math.pi/2,j1a.z))
  1484. joint1.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  1485. SetWeld(joint2,1,1, NV,NV, Vector3.new(j2.x,j2.y,j2.z), Vector3.new(j2a.x,math.pi/2,j2a.z))
  1486. joint2.C1 = CFrame.new(0,1,0) * CFrame.Angles(0,math.pi/2,0)
  1487.  
  1488. local j1,j1a = GetWeld(joint1)
  1489. local j2,j2a = GetWeld(joint2)
  1490. local j3,j3a = GetWeld(joint3)
  1491. local j4,j4a = GetWeld(joint4)
  1492. local j5,j5a = GetWeld(joint5)
  1493.  
  1494. local count = 0
  1495. local lastpos
  1496.  
  1497. while Sliding == true do
  1498. count = count + 1
  1499. Hu.PlatformStand = true
  1500. local hitz1, enz1 = RAY(Torsoz.Position+Vector3.new(0,0.03,0), dir *2.5)
  1501. local hitz2, enz2 = RAY(Torsoz.Position-Vector3.new(0,0.2,0), dir *2.5)
  1502. local ghitz, genz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  1503. bv.velocity = dir*spd + Vector3.new(0,GravPoint,0)
  1504.  
  1505. if count <= 5 then
  1506. SetWeld(joint1,count,5, j1,j1a, Vector3.new(0.5,-0.8,-0.15), Vector3.new(0,(math.pi/2)+0.1,-0.4))
  1507. SetWeld(joint2,count,5, j2,j2a, Vector3.new(-0.5,-1,0), Vector3.new(0,(math.pi/2)-0.4,0))
  1508. SetWeld(joint3,count,5, j3,j3a, Vector3.new(1.5,0.5,0), Vector3.new(-0.7,-0.24,math.pi/5))
  1509. SetWeld(joint4,count,5, j4,j4a, Vector3.new(-1.5,0.5,0), Vector3.new(-0.1,0,-math.pi/1.5))
  1510. SetWeld(joint5,count,5, j5,j5a, Vector3.new(0,1,0), Vector3.new(-0.5,-0.2,0))
  1511. end
  1512.  
  1513. if (hitz1 ~= nil and hitz1.CanCollide == true) or (hitz2 ~= nil and  hitz2.CanCollide == true) then
  1514. bv:remove()
  1515. bg:remove()
  1516. Sliding = "HitObject"
  1517. end
  1518. if ghitz ~= nil then
  1519. GravPoint = 0
  1520. Torsoz.CFrame = CFrame.new(genz, genz+dir) * CFrame.Angles(math.pi/2.2,0.24,0) + Vector3.new(0,0.7,0)
  1521. spd = spd - 0.95
  1522. else
  1523. if GravPoint > -180 then
  1524. GravPoint = GravPoint - 5.6
  1525. end
  1526. spd = spd - 0.36
  1527. end
  1528. if spd < 7 then
  1529. Sliding = false
  1530. end
  1531. wait(0.02)
  1532. end
  1533.  
  1534. if Sliding == false then
  1535. local j1,j1a = GetWeld(joint1)
  1536. local j2,j2a = GetWeld(joint2)
  1537. local j3,j3a = GetWeld(joint3)
  1538. local j4,j4a = GetWeld(joint4)
  1539. local j5,j5a = GetWeld(joint5)
  1540. for i = 1, 4 do
  1541. SetWeld(joint1,i,4, j1,j1a, Vector3.new(0.5,-1,0), Vector3.new(0,math.pi/2,0))
  1542. SetWeld(joint2,i,4, j2,j2a, Vector3.new(-0.5,-1,0), Vector3.new(0,math.pi/2,0))
  1543. SetWeld(joint3,i,4, j3,j3a, Vector3.new(1.5,0.5,0), NV)
  1544. SetWeld(joint4,i,4, j4,j4a, Vector3.new(-1.5,0.5,0), NV)
  1545. SetWeld(joint5,i,4, j5,j5a, Vector3.new(0,1,0), NV)
  1546. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  1547. 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)
  1548. bv.velocity = dir*spd + Vector3.new(0,GravPoint,0)
  1549.  
  1550. if hitz ~= nil then
  1551. GravPoint = 0
  1552. 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)
  1553. spd = spd - 0.95
  1554. else
  1555. if GravPoint > -180 then
  1556. GravPoint = GravPoint - 5.6
  1557. end
  1558. spd = spd - 0.36
  1559. end
  1560. wait(0.02)
  1561. end
  1562. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-2.6,0))
  1563. Torsoz.CFrame = CFrame.new(enz, enz+dir) + Vector3.new(0,3,0)
  1564. end
  1565. bv:remove()
  1566. bg:remove()
  1567. SlideCooldown = 10
  1568. Stand()
  1569. end
  1570.  
  1571. function KD(key)
  1572. if pause.Value == false then
  1573. if key == string.char(32) then
  1574. Space = true
  1575.  
  1576. local ghitz, genz = RAY(Torsoz.Position, Vector3.new(0,-3.7,0))
  1577. local hitz, enz = RAY(Torsoz.Position+Vector3.new(0,1.1,0), Torsoz.CFrame.lookVector*2.3)
  1578. local righthitz, rightenz
  1579. local lefthitz, leftenz
  1580.  
  1581. if HWallRunning == false then
  1582. righthitz, rightenz = RAY(Torsoz.Position, ((Torsoz.CFrame * CFrame.new(1.5,0,-0.2)).p - Torsoz.CFrame.p).unit*3.9)
  1583. lefthitz, leftenz = RAY(Torsoz.Position, ((Torsoz.CFrame * CFrame.new(-1.5,0,-0.2)).p - Torsoz.CFrame.p).unit*3.9)
  1584.  
  1585. elseif HWallRunning == "Jumping" then
  1586. 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)
  1587. 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)
  1588.  
  1589. end
  1590.  
  1591. 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
  1592. if stamina >= 10 then
  1593. --if Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude > 12 then
  1594. Dive()
  1595. --end
  1596. end
  1597. end
  1598.  
  1599. if hitz == nil and VWallRunning == "Falling" then
  1600. VWallRunning = "BackflipFromFall"
  1601. end
  1602.  
  1603. if Shift == true and Torsoz.Velocity.y > -50 and Diving == false and DivingCooldown <= 0 then
  1604. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-3.5,0))
  1605.  
  1606. if hitz ~= nil then
  1607. if Action == "Standing" and VWRCooldown == 0 then
  1608. if hitz2 == nil or hitz2.CanCollide == false then
  1609. VWR(hitz, enz)
  1610. end
  1611. end
  1612. end
  1613.  
  1614. if (HWallRunning == false or (HWallRunning == "Jumping" and (HWRLastPart ~= righthitz or HWRLastPart ~= lefthitz))) and HWRCooldown == 0 and VWallRunning == false then
  1615.  
  1616. 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
  1617. if hitz2 == nil or hitz2.CanCollide == false then
  1618. local right = (rightenz - Torsoz.Position).magnitude
  1619. local left = (leftenz - Torsoz.Position).magnitude
  1620. if right < left then
  1621. if HWallRunning == "Jumping" and HWRLastPart ~= righthitz then
  1622. HWallRunning = false
  1623. while Standing == false do
  1624. wait(0.01)
  1625. end
  1626. print("2nd Right Activated!")
  1627. HWallRun(righthitz, rightenz, -math.pi/2)
  1628. else
  1629. if hitz == nil then
  1630. print("Right Activated")
  1631. HWallRun(righthitz, rightenz, -math.pi/2)
  1632. end
  1633. end
  1634. elseif left < right then
  1635. if HWallRunning == "Jumping" and HWRLastPart ~= lefthitz then
  1636. HWallRunning = false
  1637. while Standing == false do
  1638. wait(0.01)
  1639. end
  1640. print("2nd Left Activated!")
  1641. HWallRun(lefthitz, leftenz, math.pi/2)
  1642. else
  1643. if hitz == nil then
  1644. print("Left Activated")
  1645. HWallRun(lefthitz, leftenz, math.pi/2)
  1646. end
  1647. end
  1648. end
  1649. end
  1650. end
  1651. end
  1652.  
  1653. end
  1654.  
  1655. if HWallRunning == true then
  1656. HWallRunning = "Jumping"
  1657. Action = "HWRJumping"
  1658. end
  1659.  
  1660. elseif key == string.char(48) then
  1661. Shift = true
  1662. elseif key == string.char(50) then
  1663. if Action == "Standing" then
  1664. Sit()
  1665. elseif HWallRunning == true then
  1666. HWRGravDrop = true
  1667. end
  1668. elseif key == string.char(52) then
  1669. 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
  1670. print("Sliding")
  1671. Slide()
  1672. end
  1673. elseif key == "a" then
  1674. VWRLeft = true
  1675. elseif key == "d" then
  1676. VWRRight = true
  1677. end
  1678. end
  1679. end
  1680.  
  1681. function KU(key)
  1682. if key == string.char(32) then
  1683. Space = false
  1684. elseif key == string.char(48) then
  1685. Shift = false
  1686. elseif key == string.char(50) then
  1687. if Action == "Sitting" then
  1688. Stand()
  1689. end
  1690. elseif key == string.char(52) then
  1691. Sliding = false
  1692. elseif key == "a" then
  1693. VWRLeft = false
  1694. elseif key == "d" then
  1695. VWRRight = false
  1696. end
  1697. end
  1698.  
  1699. mouse.KeyDown:connect(function(key) KD(key) end)
  1700. mouse.KeyUp:connect(function(key) KU(key) end)
  1701.  
  1702. Joint1 = Instance.new("Snap", Torsoz)
  1703. GetWeld(Joint1)
  1704. Joint2 = Instance.new("Snap", Torsoz)
  1705. GetWeld(Joint2)
  1706. Joint3 = Instance.new("Snap", Torsoz)
  1707. GetWeld(Joint3)
  1708. Joint4 = Instance.new("Snap", Torsoz)
  1709. GetWeld(Joint4)
  1710. Joint5 = Instance.new("Snap", Torsoz)
  1711. GetWeld(Joint5)
  1712. Stand()
  1713.  
  1714. local animatebg = Instance.new("BodyGyro")
  1715. animatebg.D = 100
  1716. local GravAction = "Idle"
  1717. local PrevGravAction = GravAction
  1718.  
  1719. local prevrapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  1720. local prevlapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  1721. local hue = 0
  1722. local recyclecount = 0
  1723. local tickoffset = tick()
  1724. local fadetab = {}
  1725. local fadetab2 = {}
  1726. local animatebgcount = 0
  1727.  
  1728. for i = 1, 13 do
  1729. local p = P:Clone()
  1730. p.Name = "Part"..i
  1731. local mesh = Instance.new("SpecialMesh", p)
  1732. mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
  1733. mesh.TextureId = "http://www.roblox.com/Asset/?id=48358980"
  1734. table.insert(fadetab, {p, mesh})
  1735. end
  1736. for i = 1, 13 do
  1737. local p = P:Clone()
  1738. p.Name = "Part"..i
  1739. local mesh = Instance.new("SpecialMesh", p)
  1740. mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
  1741. mesh.TextureId = "http://www.roblox.com/Asset/?id=48358980"
  1742. table.insert(fadetab2, {p, mesh})
  1743. end
  1744.  
  1745. game:service("RunService").Stepped:connect(function()
  1746. GravAction = "Idle"
  1747. hue = hue + 3
  1748. hue = hue % 360
  1749.  
  1750. ------------- anim angle changing --------
  1751. if animangle > math.pi then
  1752. animplus = false
  1753. elseif animangle < -math.pi then
  1754. animplus = true  
  1755. end
  1756. if animplus == true then
  1757. animangle = animangle + animspeed
  1758. elseif animplus == false then
  1759. animangle = animangle - animspeed
  1760. end
  1761.  
  1762. local hitz, enz = RAY(Torsoz.Position, Vector3.new(0,-3.9,0))
  1763. if Shift == true then
  1764. Hu.WalkSpeed = sprint
  1765. else
  1766. Hu.WalkSpeed = 16
  1767. end
  1768. if (FOV >= 70 and FOV < 74) and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude > 25 then
  1769. FOV = FOV + 1
  1770. elseif (FOV <= 74 and FOV > 70) and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 20 then
  1771. FOV = FOV - 1
  1772. end
  1773. if pause.Value == true then
  1774. Hu.WalkSpeed = 0
  1775. end
  1776. if Sitting == true then
  1777. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-2.2,0))
  1778. Hu.PlatformStand = true
  1779. if hitz2 == nil then
  1780. Stand()
  1781. end
  1782. end
  1783. if Diving == true then
  1784. Hu.PlatformStand = true
  1785. DivingBV.velocity = Vector3.new(DivingDir.x*(sprint+2),GravPoint,DivingDir.z*(sprint+2))
  1786. DivingBG.cframe = CFrame.new(Torsoz.Position, Torsoz.Position+DivingBV.velocity) * CFrame.Angles(-math.pi/2,0,0)
  1787.  
  1788. if GravPoint > -180 then
  1789. GravPoint = GravPoint - 2
  1790. end
  1791. end
  1792. if DivingCooldown > 0 then
  1793. DivingCooldown = DivingCooldown - 1
  1794. end
  1795. if HWallRunning == true then
  1796. if HWRGravDrop == false then
  1797. GravPoint = GravPoint - 0.4
  1798. else
  1799. GravPoint = GravPoint - 2
  1800. end
  1801. elseif HWallRunning == "Jumping" then
  1802. GravPoint = GravPoint - 1.7
  1803. end
  1804. ----------------------------- stamina ----------------------------------------
  1805. if Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude > 18 and Action == "Standing" and Shift == true then
  1806. if stamina > 0 then
  1807. stamina = stamina - 0.5
  1808. if stamina < 0 then
  1809. Shift = false
  1810. stamina = 0
  1811. end
  1812. else
  1813. Shift = false
  1814. stamina = 0
  1815. end
  1816. if Action == "Standing" then
  1817. animspeed = 0.85
  1818. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/4.85,0,0))
  1819. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/4.85,0,0))
  1820. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/3.5,0,0))
  1821. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/3.5,0,0))
  1822. end
  1823. elseif Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude > 12 and Action ~= "Sliding" then
  1824. if stamina < maxstamina then
  1825. stamina = stamina + 0.5
  1826. if stamina > maxstamina then
  1827. stamina = maxstamina
  1828. end
  1829. else
  1830. stamina = maxstamina
  1831. end
  1832. if Action == "Standing" then
  1833. animspeed = 0.65
  1834. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/7,0,0))
  1835. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/7,0,0))
  1836. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/5,0,0))
  1837. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/5,0,0))
  1838. end
  1839. elseif Vector3.new(Torsoz.Velocity.x, 0, Torsoz.Velocity.z).magnitude < 2 then
  1840. animspeed = 0.1
  1841. if Action == "Standing" then
  1842. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/38,0,0))
  1843. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/38,0,0))
  1844. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new(animangle/30,0,0))
  1845. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new(-animangle/30,0,0))
  1846. end
  1847. if stamina < maxstamina then
  1848. if Sitting == false then
  1849. stamina = stamina + 0.65
  1850. else
  1851. stamina = stamina + 1.02
  1852. end
  1853. if stamina > maxstamina then
  1854. stamina = maxstamina
  1855. end
  1856. else
  1857. stamina = maxstamina
  1858. end
  1859. end
  1860.  
  1861. if hitz == nil then
  1862. if Torsoz.Velocity.y > 1 or (Torsoz.Velocity.y < -1 and Torsoz.Velocity.y > -90) then
  1863. if Action == "Standing" then
  1864. GravAction = "Rising"
  1865. animspeed = 0.1
  1866. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.5,-1,0), Vector3.new(-animangle/38,0,0))
  1867. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.5,-1,0), Vector3.new(animangle/38,0,0))
  1868. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.5,0.5,0), Vector3.new((math.pi-0.2)+(animangle/30),0,0))
  1869. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.5,0.5,0), Vector3.new((math.pi-0.2)+(-animangle/30),0,0))
  1870. if animatebg.Parent ~= nil then
  1871. animatebg.Parent = Torsoz
  1872. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  1873. local lokvec = Torsoz.CFrame.lookVector*100
  1874. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z))
  1875. animatebg.Parent = nil
  1876. end
  1877. end
  1878. end
  1879. end
  1880.  
  1881. if hitz == nil then
  1882. local hitz2, enz2 = RAY(Torsoz.Position, Vector3.new(0,-6,0))
  1883. if hitz2 == nil then
  1884. if Torsoz.Velocity.y < -90 then
  1885. if Action == "Standing" then
  1886. GravAction = "Falling"
  1887. animspeed = 1.1
  1888. animatebg.Parent = Torsoz
  1889. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  1890. local lokvec = Torsoz.CFrame.lookVector*100
  1891. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z)) * CFrame.Angles(-math.pi/11,animangle/70,0)
  1892. SetWeld(Joint1,1,1, NV,NV, Vector3.new(0.45,-0.8,0), Vector3.new((animangle/27)-0.3,0,0.18))
  1893. SetWeld(Joint2,1,1, NV,NV, Vector3.new(-0.45,-0.8,0), Vector3.new((-animangle/27)-0.3,0,-0.18))
  1894. SetWeld(Joint3,1,1, NV,NV, Vector3.new(1.4,0.5,0), Vector3.new((math.pi+0.2)+(animangle/26),0,0.18))
  1895. SetWeld(Joint4,1,1, NV,NV, Vector3.new(-1.4,0.5,0), Vector3.new((math.pi+0.2)+(-animangle/26),0,-0.18))
  1896. end
  1897. end
  1898. elseif hitz2.CanCollide == true then
  1899. if animatebg.Parent ~= nil then
  1900. animatebg.Parent = Torsoz
  1901. animatebg.maxTorque = Vector3.new(1/0,10000,1/0)
  1902. local lokvec = Torsoz.CFrame.lookVector*100
  1903. animatebg.cframe = CFrame.new(NV, Vector3.new(lokvec.x,0,lokvec.z))
  1904. animatebg.Parent = nil
  1905. end
  1906. end
  1907. end
  1908.  
  1909. if GravAction == "Idle" and animatebg.Parent ~= nil then
  1910. animatebg.Parent = nil
  1911. end
  1912.  
  1913. if math.abs(tickoffset - tick()) > 0.05 then
  1914. tickoffset = tick()
  1915. local flowcolor = HSV(hue, 0.7,1)
  1916. recyclecount = (recyclecount % #fadetab) + 1
  1917. if flow.Value > 25 then
  1918. local lapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  1919. local rapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  1920. local p = fadetab[recyclecount]
  1921. p[1].Parent = m
  1922. p[1].CFrame = CFrame.new((lapos+prevlapos)/2, lapos)
  1923. p[2].Scale = Vector3.new(0.5,0.5,(lapos-prevlapos).magnitude*2)
  1924. p[2].VertexColor = Vector3.new(flowcolor.r,flowcolor.g,flowcolor.b)
  1925. p[1].Transparency = math.abs((flow.Value/120) - 0.8)
  1926. p[1].Transparency = p[1].Transparency + (1/#fadetab)
  1927. local p = fadetab2[recyclecount]
  1928. p[1].Parent = m
  1929. p[1].CFrame = CFrame.new((rapos+prevrapos)/2, rapos)
  1930. p[2].Scale = Vector3.new(0.5,0.5,(rapos-prevrapos).magnitude*2)
  1931. p[2].VertexColor = Vector3.new(flowcolor.r,flowcolor.g,flowcolor.b)
  1932. p[1].Transparency = math.abs((flow.Value/120) - 0.8)
  1933. p[1].Transparency = p[1].Transparency + (1/#fadetab)
  1934. end
  1935.  
  1936. for i, v in pairs(fadetab) do
  1937. if v[1].Transparency < 0.9 then
  1938. v[1].Transparency = v[1].Transparency + (1/#fadetab)
  1939. fadetab2[i][1].Transparency = fadetab2[i][1].Transparency + (1/#fadetab)
  1940. elseif v[1].Transparency ~= 1 then
  1941. v[1].Transparency = 1
  1942. v[1].Position = Vector3.new(50000,0,0)
  1943. fadetab2[i][1].Transparency = 1
  1944. fadetab2[i][1].Position = Vector3.new(50000,0,0)
  1945. end
  1946. end
  1947.  
  1948. prevrapos = (RA.CFrame * CFrame.new(0,-1,0)).p
  1949. prevlapos = (LA.CFrame * CFrame.new(0,-1,0)).p
  1950. end
  1951.  
  1952. if flow.Value > 140 then
  1953. if char.Parent ~= nil then
  1954. char:remove()
  1955. end
  1956. end
  1957.  
  1958. if flowcooldown > 0 then
  1959. flowcooldown = flowcooldown - 1
  1960. end
  1961. if HWRCooldown > 0 then
  1962. HWRCooldown = HWRCooldown - 1
  1963. end
  1964. if VWRCooldown > 0 then
  1965. if hitz ~= nil and VWRCooldown > 0 then
  1966. VWRCooldown = VWRCooldown - 1
  1967. end
  1968. end
  1969. if SlideCooldown > 0 then
  1970. SlideCooldown = SlideCooldown - 1
  1971. end
  1972.  
  1973. if Action == "HWallRunning" or Action == "VWallRunning" then
  1974. flow.Value = flow.Value + 0.24
  1975. if flow.Value > 100 then
  1976. flow.Value = 100
  1977. end
  1978. flowcooldown = 40
  1979. elseif Action == "Diving" then
  1980. flowcooldown = 30
  1981. elseif Action == "Sliding" then
  1982. flowcooldown = 15
  1983. elseif Action == "Standing" or Action == "Sitting" then
  1984. if flow.Value > 0 and flowcooldown <= 0 then
  1985. flow.Value = flow.Value - 0.37
  1986. if flow.Value < 0 then
  1987. flow.Value = 0
  1988. end
  1989. end
  1990. end
  1991.  
  1992. cam.FieldOfView = FOV
  1993. prevanimbgcount = animatebgcount
  1994. sprint = defsprint + ((flow.Value/100)*2.4)
  1995. PrevGravAction = GravAction
  1996. Calculate()
  1997. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement