So I’m trying to make a system to make sure every joins the game before it starts but it seems to not be able to get the teleport table and just returns a hash with no errors, what have I done wrong:
Players.PlayerAdded:Connect(function(player)
if gameStarted then
player:Kick("Game already started, please join the next game.")
return
end
if maxPlayers == nil then
local joinData = player:GetJoinData()
if joinData then
print(joinData.TeleportData)
end
maxPlayers = player:GetJoinData().MaxPlayers
end
playersJoined = playersJoined + 1
updateAllPlayersUI()
if playersJoined == 1 then
task.wait(waitingTime)
if playersJoined < maxPlayers then
hideAllPlayersUI()
else
gameStarted = true
end
end
end)