Advertisement
Guest User

Testing SpiderThing

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