Advertisement
hubertzoo90

Untitled

Mar 23rd, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local runService = game:GetService("RunService")
  4. local userInput = game:GetService("UserInputService")
  5. local spinning = false
  6. local ladder
  7. local connection
  8.  
  9. local function toggleLadderSpin()
  10. local playerPlaced = workspace:FindFirstChild("playerPlaced")
  11. if not playerPlaced then return end
  12.  
  13. if not spinning then
  14. for _, obj in pairs(playerPlaced:GetChildren()) do
  15. if obj:IsA("Model") and obj.Name == "YOUR USERNAME HERE_ladder" then
  16. ladder = obj:FindFirstChild("Handle") or obj:FindFirstChildWhichIsA("Part")
  17. if ladder then
  18. ladder.Anchored = false
  19. ladder.Massless = true
  20.  
  21. ladder.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90), 0, 0)
  22.  
  23.  
  24. spinning = true
  25. connection = runService.Heartbeat:Connect(function()
  26. if ladder and character and character:FindFirstChild("HumanoidRootPart") then
  27. local root = character.HumanoidRootPart
  28. ladder.CFrame = root.CFrame * CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90), tick() * 5, 0)
  29. end
  30. end)
  31.  
  32.  
  33. ladder.Touched:Connect(function(hit)
  34. if spinning then
  35. local victim = hit.Parent
  36. if victim and victim:FindFirstChild("Humanoid") then
  37. local flingDirection = Vector3.new(math.random(-50, 50), 150, math.random(-50, 50))
  38. victim:FindFirstChild("HumanoidRootPart").Velocity = flingDirection
  39. end
  40. end
  41. end)
  42. end
  43. end
  44. end
  45. else
  46.  
  47. spinning = false
  48. if connection then connection:Disconnect() end
  49. if ladder then
  50. ladder.Anchored = true
  51. end
  52. end
  53. end
  54.  
  55.  
  56. userInput.InputBegan:Connect(function(input, gameProcessed)
  57. if not gameProcessed and input.KeyCode == Enum.KeyCode.F then
  58. toggleLadderSpin()
  59. end
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement