Blixtown

Untitled

Jul 5th, 2024 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. -- Function to teleport to all players
  2. function teleportToAll()
  3. local player = game.Players.LocalPlayer
  4.  
  5. -- Function to teleport to a player
  6. local function teleportTo(targetPlayer)
  7. if targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
  8. player.Character:SetPrimaryPartCFrame(targetPlayer.Character.HumanoidRootPart.CFrame)
  9. end
  10. end
  11.  
  12. -- Loop through all players and teleport to each one
  13. for _, otherPlayer in pairs(game.Players:GetPlayers()) do
  14. if otherPlayer ~= player then
  15. teleportTo(otherPlayer)
  16. wait(2.5) -- Adjust delay as needed
  17. end
  18. end
  19. end
  20.  
  21. -- Toggle the teleport to all function with a key press (e.g., "T")
  22. local UserInputService = game:GetService("UserInputService")
  23.  
  24. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  25. if input.KeyCode == Enum.KeyCode.T and not gameProcessed then
  26. teleportToAll()
  27. end
  28. end)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment