so i made it reserve a server but i dont know what to do after doing this in the server script. i want to make a tower defense game and this is the furthest ive gone so far
local TeleportService = game:GetService("TeleportService")
local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
print(reservedServerCode)
if you want to teleport the players to the place, you need to use TeleportService:TeleportToPrivateServer. what you need for the parameters for this function is the players you want to teleport, the :ReserveServer function (you already have that), and the placeID you want to teleport those players into.
here’s an example: this is from the wiki, so check it out if you need to : D
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local Code = TeleportService:ReserveServer(game.PlaceId) -- returns a code
local Players = Players:GetPlayers()
TS:TeleportToPrivateServer(game.PlaceId,Code,Players) -- this teleports the player into the game you specified
local TeleportService = game:GetService("TeleportService")
local Code = TeleportService:ReserveServer(game.PlaceId) -- returns a code
local Players = game:GetService("Players")
local players = Players:GetPlayers()
TeleportService:TeleportToPrivateServer(game.PlaceId,Code,players) -- this teleports the player into the game you specified