Advertisement
EXO_DEV

Steep Steps fly/fling script

Dec 4th, 2023 (edited)
957
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.39 KB | Source Code | 0 0
  1. --[[
  2.  
  3.  
  4.         made by _Exec4tble_#2226
  5.         execute loadstring below to stay updated:
  6. loadstring(game:HttpGet('https://pastebin.com/raw/0dunVe3x'))()
  7.  
  8.  
  9.         -------------------------
  10.         hold Q/E to move DOWN/UP
  11.         press X to toggle the script
  12.         press F to toggle fling mode
  13.         -------------------------
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. ]]--
  26. local pl = game.Players.LocalPlayer
  27. local uis = game:GetService("UserInputService")
  28. local placed = game.Workspace:FindFirstChild("playerPlaced")
  29. local lad = nil
  30. local ch = pl.Character
  31. local hrp = ch.HumanoidRootPart
  32. if _G.began and typeof(_G.began) == "RBXScriptConnection" then _G.began:Disconnect() end; task.wait()
  33. if _G.ended and typeof(_G.ended) == "RBXScriptConnection" then _G.ended:Disconnect() end; task.wait()
  34. state = true
  35. flingState = false
  36. moveVal = 0
  37. loopVal = 0
  38. _G.began = nil
  39. _G.ended = nil
  40. if placed:FindFirstChild(pl.Name .. "_ladder") then
  41.     lad = placed:FindFirstChild(pl.Name .. "_ladder")
  42. end
  43.  
  44. _G.began = uis.InputBegan:Connect(function(key, typ)
  45.     if typ then return end
  46.  
  47.     if key.KeyCode == Enum.KeyCode.X then
  48.         state = not state
  49.         if placed:FindFirstChild(pl.Name .. "_ladder") then
  50.             lad = placed:FindFirstChild(pl.Name .. "_ladder")
  51.         end
  52.         print(state and "turned on" or "turned off")
  53.     elseif key.KeyCode == Enum.KeyCode.E then
  54.         moveVal = 1
  55.     elseif key.KeyCode == Enum.KeyCode.Q then
  56.         moveVal = -1
  57.     elseif key.KeyCode == Enum.KeyCode.F then
  58.         flingState = not flingState
  59.     end
  60. end)
  61. _G.ened = uis.InputEnded:Connect(function(key, typ)
  62.     if typ then return end
  63.  
  64.     if key.KeyCode == Enum.KeyCode.E then
  65.         moveVal = 0
  66.     elseif key.KeyCode == Enum.KeyCode.Q then
  67.         moveVal = 0
  68.     end
  69. end)
  70.  
  71. function rng(n)
  72.     return math.random(-n*n,n*n)
  73. end
  74. local incr = true
  75. while task.wait() do
  76.     if state then
  77.         if incr then
  78.             loopVal += 0.15
  79.             if loopVal >= 1 then
  80.                 incr = false
  81.             end
  82.         else
  83.             loopVal -= 0.15
  84.             if loopVal <= -3 then
  85.                 incr = true
  86.             end
  87.         end
  88.         local suc, res = pcall(function()
  89.             ch = pl.Character
  90.             hrp = ch.HumanoidRootPart
  91.             local defPos = hrp.CFrame * CFrame.new(0,-3.5+moveVal,0) * CFrame.Angles(math.rad(90),0,0)
  92.             local flingPos = hrp.CFrame * CFrame.new(0,moveVal+loopVal,-6) * CFrame.Angles(math.rad(90),0,0)
  93.            
  94.             lad:SetPrimaryPartCFrame(flingState and flingPos or defPos)
  95.             for _,part in next, lad:GetChildren() do
  96.                 if part:IsA("BasePart") then
  97.                     part.AssemblyLinearVelocity = flingState and Vector3.new(rng(50),300,rng(50)) or Vector3.zero
  98.                     part.AssemblyAngularVelocity = flingState and Vector3.zero or Vector3.zero
  99.                     if flingState then
  100.                         part.CanCollide = false
  101.                     else
  102.                         part.CanCollide = (not part.Name == "Center" and false or true)
  103.                     end
  104.                 end
  105.             end
  106.         end)
  107.         if not suc and (not res:lower():find("setprim")) then warn(res) end
  108.     else
  109.         for _,part in next, lad:GetChildren() do
  110.             if part:IsA("BasePart") then
  111.                 part.CanCollide = true
  112.             end
  113.         end
  114.     end
  115. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement