Basically I want it like this.
The player joins the matchmaking place (cause they were teleported from the lobby to this place)
After 70 seconds, all the people in that server are teleported to another place (the map). I want it to be a private server cause I dont want people joining mid-game.
After the game is finished (I can script this myself), they are teleported back to the lobby place.
I tried this yesterday with this script:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") local PlaceId = 5002451166 local code = TS:ReserveServer(game.PlaceId) -- Returns a code local players = Players:GetPlayers() -- Get a list of all players game.Players.PlayerAdded:Connect(function(player) wait(7) TS:TeleportToPrivateServer(game.PlaceId,code,players) -- Actually teleport the players
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
But it didn't work. Please help! c:
You are trying to teleport them to the same place without using the PlaceId variable you set
Just note that this is only the teleporting part and not when it teleports all players after 70 seconds.
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") local PlaceId = 5002451166 local code = TS:ReserveServer(PlaceId) -- Returns a code (used to be game.PlaceId not the variable) This would have to be inside the loop otherwise it would use the same code and other players would be teleported to the same server which has started the game already. local players = Players:GetPlayers() -- Get a list of all players TS:TeleportToPrivateServer(game.PlaceId,code,players) -- Actually teleport the players
If you add game.Players.PlayerAdded:Connect(function(player) then everytime a new player joins it would start the script again and make it run.