I have a system that after certain event will happen, the game will kick you, setting this event value to 1, and each time a player joins, im checking if this value is equal to 1 to teleport them to an empty server, but I don’t know if you can do that in roblox (?), so I’m asking for help in here, hope somebody knows the solution!
Take a look at this code sample taken directly from the documentation:
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TeleportService:ReserveServer(game.PlaceId)
local players = Players:GetPlayers()
TeleportService:TeleportToPrivateServer(game.PlaceId, code, players)
-- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen
Although you should use TeleportService:TeleportAsync() instead of TeleportService:TeleportToPrivateServer().