Currently I am trying to make a gui that asks for a place ID, and when entered places all players into that game. I'm fairly new to scripting so I'm not exactly sure how to do this. Any sort of tip helps. Thanks.
How does the ':place' command work on different admins?
1 answer
This might work. I'm not sure how to create a text field gui, so here is how to teleport with a chat message. The player types in the ID of the place they would like everyone to be teleported to.
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
Players = game:GetService("Players")
players = Players:GetPlayers()
print("Teleport")
game:GetService("TeleportService"):Teleport(players, msg) --teleport
end
end)
end)
If only a specific player is supposed to be able to perform this, put an if statement in the code above. I recommend you use a variable of the name of the player that is allowed to do this, or use teams to your advantage. Feel free to use whatever works for you.
PLEASE note that you cannot be teleported to places within Roblox Studio, so don't be alarmed when you get an error in the output. The game must be published and tested for real.
This is written from my head, so there may be an error, but it will be easy to fix considering there is quite a bit of documentation about TeleportService.
If this does not work for you, please comment so that I can make something that works better for you.
Merry Christmas! :D
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Yep, this is the way to do it.
Thanks -- trying this out right now.