Advertisement
DrawingJhon

Ladder Script

Jan 29th, 2023 (edited)
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local char = player.Character
  3. local root = char.HumanoidRootPart
  4.  
  5. local ladder = workspace.playerPlaced:WaitForChild(player.Name.."_ladder")
  6. local main = ladder:WaitForChild("Main")
  7.  
  8. local gui = Instance.new("ScreenGui")
  9. gui.Name = "LadderGui"
  10.  
  11.  
  12. local ct = {}
  13.  
  14. table.insert(ct, game:GetService("RunService").Heartbeat:Connect(function()
  15.     if not actived then return end
  16.     sethiddenproperty(player,"MaximumSimulationRadius",math.huge)
  17.     sethiddenproperty(player,"SimulationRadius",999999999)
  18. end))
  19.  
  20. table.insert(ct, game:GetService("RunService").RenderStepped:Connect(function()
  21.     root.CFrame = CFrame.new(main.Position)
  22. end))
  23.  
  24. local myBv = root:FindFirstChildOfClass("BodyVelocity") or Instance.new("BodyVelocity")
  25. myBv.MaxForce = Vector3.one * math.huge
  26. myBv.Velocity = Vector3.zero
  27. myBv.Parent = root
  28.  
  29. local bg = main:FindFirstChildOfClass("BodyGyro") or Instance.new("BodyGyro")
  30. bg.MaxTorque = Vector3.one * math.huge
  31. bg.CFrame = main.CFrame --CFrame.Angles(math.rad(90), 0, 0)
  32. bg.Parent = main
  33.  
  34. local bv = main:FindFirstChildOfClass("BodyVelocity") or Instance.new("BodyVelocity")
  35. bv.MaxForce = Vector3.one * math.huge
  36. bv.Velocity = Vector3.new(0, 0, 0)
  37. bv.Parent = main
  38.  
  39. _G.Disconnect = function()
  40.     for i, v in pairs(ct) do
  41.         v:Disconnect()
  42.     end
  43.     bg:Destroy()
  44.     bv:Destroy()
  45.     myBv:Destroy()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement