Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to teleport to all players
- function teleportToAll()
- local player = game.Players.LocalPlayer
- -- Function to teleport to a player
- local function teleportTo(targetPlayer)
- if targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart") then
- player.Character:SetPrimaryPartCFrame(targetPlayer.Character.HumanoidRootPart.CFrame)
- end
- end
- -- Loop through all players and teleport to each one
- for _, otherPlayer in pairs(game.Players:GetPlayers()) do
- if otherPlayer ~= player then
- teleportTo(otherPlayer)
- wait(2.5) -- Adjust delay as needed
- end
- end
- end
- -- Toggle the teleport to all function with a key press (e.g., "T")
- local UserInputService = game:GetService("UserInputService")
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.T and not gameProcessed then
- teleportToAll()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment