currently making admin panel and decided to add a “rejoin” button to rejoin all players. But keep getting this error message that says validation error. Who knows how to fix this?
script.Parent.MouseButton1Click:Connect(function()
local id = game.GameId
local serverid = game.JobId
local tp = game:GetService("TeleportService")
for i,v in pairs(game.Players:GetChildren()) do
tp:TeleportToPlaceInstance(id, serverid, v)
end
end)
4 Likes
On the docs, i found it says:
“The numerous teleport functions have been combined into a single method, TeleportAsync , which should be used instead”
With this, your script would look like:
script.Parent.MouseButton1Click:Connect(function()
local tp = game:GetService("TeleportService")
tp:TeleportAsync(game.PlaceId, game.Players:GetPlayers())
end)
1 Like
It works with the teleport part but when it actually rejoins it comes up with this weird error message for disconnecting I have tried this a few times and this always comes up. huh?
2 Likes
JxstKilo
(JxstKilo)
October 15, 2023, 7:11pm
#4
Make sure to check game settings.
security → allow third party teleports
(I think that should work)
1 Like
17kSeso
(Semih)
October 15, 2023, 7:19pm
#5
I think you need teleport from server
2 Likes
I checked and third-party-teleports is enabled.
1 Like
what do you mean by that? I don’t really understand.
2 Likes
17kSeso
(Semih)
October 15, 2023, 7:21pm
#8
is it server script or localscript
1 Like
Dimon9lul
(Dimon)
October 15, 2023, 7:23pm
#9
No, this doesn’t effect it at all.
1 Like
17kSeso
(Semih)
October 15, 2023, 7:23pm
#10
You cannot teleport Other players from local script You should go normal server script
1 Like
Dimon9lul
(Dimon)
October 15, 2023, 7:26pm
#12
I would recommend trying out a very simple function, the Teleport() function. It’s very easy to use. Example of using:
game.TeleportService:Teleport(placeId, player: Instance)
That’s it, Try it out!
1 Like
Encaptor
(Encaptor)
October 15, 2023, 7:27pm
#13
He’s trying to teleport the player to the same server so that wouldn’t accomplish what he wants.
1 Like
Dimon9lul
(Dimon)
October 15, 2023, 7:28pm
#14
It will. I looked it up. It should at least.
1 Like
yeah, you’ve got that correct.
1 Like
Encaptor
(Encaptor)
October 15, 2023, 7:28pm
#16
It’ll be a different server, not the same one.
1 Like
wait, really? Let me try that right now.
1 Like
oh wait nvm I can’t since I only have 1 server up…
1 Like
Dimon9lul
(Dimon)
October 15, 2023, 7:29pm
#19
Hold up a minute. Is it even possible to teleport in Studio servers anyway?
1 Like
Encaptor
(Encaptor)
October 15, 2023, 7:30pm
#20
You can’t teleport in Studio servers
1 Like