Inoob8C

Untitled

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