I’m testing in the roblox game itself.
Is the script your using a server script or a local script, if local script then change it to server script
Oh, is that what we are looking for? I will look for something else I guess…
serverscript. I said it already in one of the posts above.
Show me the full third line please
You can’t teleport multiple players with :Teleport()
what can I teleport multiple players with, A guy above said to try “Teleport” but it used to be “TeleportAsync”.
Like he said use TeleportAsync (not trying to sound condescending just need to use more words for the character limit)
thats where I got the error from after it rejoined saying Connection attempt failed.
for _,v in pairs(game.Players:GetPlayers()) do
tp:Teleport(game.PlaceId, v)
end
Then the script works, it’s just an issue on your part.
oh ok, let me try it for my friend
Why is there a bot liking every post?
got to go now, not sure about the bot but I’ll try in the morning, thanks for all your help.
I found the following statement about a different function: TeleportPartyAsync()
Currently this function may not work reliably when teleporting Players to the same place they are currently in.
Considering it doesn’t work for that function, it might not work for the others aswell. As an alternative, you could just kick all, and hope they will rejoin…
script.Parent.MouseButton1Click:Connect(function()
for _, player in game.Players:GetPlayers() do
player:Kick("Please rejoin")
end
end)
I know it is not an ideal solution : /
not the best but it’ll have to do for now
So I finally found out what you were doing wrong with the teleport async. The order of the instances called in the function were wrong and you forgot using a teleport options instance as well. Here is a correct version of the code you wrote:
script.Parent.MouseButton1Click:Connect(function()
local id = game.GameId
local serverid = game.JobId
local Options = Instance.new("TeleportOptions")
local Options.ServerInstanceId = serverid
local tp = game:GetService("TeleportService")
for i,v in pairs(game.Players:GetChildren()) do
tp:TeleportAsync(id, v, Options)
end
end)
I hope this will work!
just run this code:
(also make sure u are running this on a local script and the parent is your button)
teleport_service=game:GetService('TeleportService')
script.Parent.MouseButton1Click:Connect(function()
for i,v in pairs(game.Players:GetChildren()) do
teleport_service:Teleport(PLACEIDHERE, v)
end
end)