I tried to reserve a server on my game by clicking on a gui button, just see it as to create a party
local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TS:ReserveServer(game.PlaceId) -- Returns a code
local players = Players:GetPlayers() -- Get a list of all players
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function()
TS:TeleportToPrivateServer(game.PlaceId,code,players)
end)
I used the code that is provided on the roblox developer page but it always give me this error
I also tried to change my code and add this
local players = {}
for _,v in pairs(Players) dothis for loop
table.insert(players,v)
end
But it still doesnt work…