So I’m trying to teleport all the players in a server to another game. I’ve tried using a for loop to teleport all the players and I’ve tried using TeleportPartyAsync(). Both times I got the same error:
Teleport Failed Because The Previous Teleport Is In Processing.
I’ve looked this up and nothing I found helped.
Here is my code:
local TeleportService = game:GetService("TeleportService")
local PlayerAray = game.Players:GetChildren()
TeleportService:TeleportPartyAsync(6331956095, PlayerAray)
Instead of :TeleportPartyAsync() use :Teleport instead. Your solution of for looping would have been good if you had used this method instead of TeleportPartyAsync. It’s never worked for me, at least the way I did it, but you can still accomplish a working teleport on all players using Teleport.
Example code:
local PlayersToTeleport = game.Players:GetChildren()
for i, Player in pairs(PlayersToTeleport) do
if Player:IsA("Player") then
TeleportService:Teleport(6331956095, Player)
end
end
Lemme know if this worked, I didn’t code it in studio so might have missed something.
This isn’t working because you have no waits or anything. The script runs right when the server starts so there are no players in the game when it runs. Maybe add a PlayerAdded function or a wait for testing. Also, your first solution of TeleportPartyAsync() is more clean and efficient.
Is your script disabled? I’ve done this type of mistake before. If you’re getting no errors, and the script seems like it should work, make sure you don’t have “Disabled” on the properties menu of the script, checked.
If it’s checked, it won’t run.
Also you can put print() statements in your code to see where the code is going at fault. Sometimes an error won’t occur but something might not being getting registered. If you have an if statement in your code and that if statement isn’t being met, and the TeleportService code is in that if statement, it won’t error, and nothing will happen cuz the if statement wasn’t met with the true value. I’d check over your code