I’m making a match making system, and I have it all down pat, to get each player into an array. HOWEVER! For some reason I’m receiving the error:
it occurs on this line:
TS:TeleportToPrivateServer(5241811526,ReservedServer,{Server[Player.UserId].Players})
Chunk of code:
if Server[Player.UserId] then
local ReservedServer = TS:ReserveServer(5241811526)
for i,v in pairs(Server[Player.UserId].Players) do
print (i,v)
end
TS:TeleportToPrivateServer(5241811526,ReservedServer,{Server[Player.UserId].Players})
print("Teleported")
end
How I add players into the array:
function module.new(Player)
local Data = {
["Player"] = Player;
Players = {};
IsPassword = false;
Password = nil;
}
local self = setmetatable(Data, module)
return self
end
function module:AddPlayer(Player)
table.insert(self.Players, Player)
end
Not sure which part the error is coming from, I never really use :teleporttoprivateserver. The print check I do before teleporting prints each and every player that is in the array without hesitation. Theres no way that the player’s arn’t actually the player object since all I do isuse the following module function to add the players to the list. Any ideas?
EDIT: If I just do Server[Player.UserId][“Player”] it seems to teleport that said player (the owner of the match making)