Advertisement
SigmaBoy456

Baseplate anti fall

Sep 14th, 2024 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local hrp = character:WaitForChild("HumanoidRootPart")
  4.  
  5. -- Create a large part
  6. local part = Instance.new("Part")
  7. part.Size = Vector3.new(100000, 1, 100000)
  8. part.Position = Vector3.new(0, -50, 0)
  9. part.Name = "Anti Fall"
  10. part.Anchored = true -- Anchor the part so it stays in place
  11. part.Parent = game.Workspace
  12. part.Color = Color3.new(1, 1, 1)
  13.  
  14. -- When something touches the part
  15. part.Touched:Connect(function(hit)
  16. -- Check if the touching part belongs to a character
  17. local humanoid = hit.Parent:FindFirstChildOfClass("Humanoid")
  18. if humanoid then
  19. hrp.CFrame = CFrame.new(0, math.random(200, 500), 0) -- Teleport the player
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement