local TeleportOptions = Instance.new("TeleportOptions")
local code = TeleportService:ReserveServer(PlaceId)
TeleportService:TeleportToPrivateServer(PlaceId, code, GameData["Team"])
I completely missed the part about “TeleportToPrivateServer” when I first started to read those docs yesterday, but now I also don’t have to send any data as well what makes it even better. Anyways thx for the help man.
One more thing, so you should be able to send data with "TeleportToPrivateServer, so I gave it a try, but then it’s still nil, and apparently for other ppl it did work, and I am pretty sure that I did it exactly like them, but it doesn’t work for me. any idea why? Since I also put the arguments right as well, here is my code.
function GameManager.StartGame(GameData)
local self = setmetatable(GameData, GameManager)
local TeamStats = CreateStats()
local SpawnPointUsed = {}
print("hi")
local TeleportOptions = Instance.new("TeleportOptions")
local code = TeleportService:ReserveServer(PlaceId)
TeleportService:TeleportToPrivateServer(PlaceId, code, GameData["Team"],_,GameData["Team"])
local PlayerService = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local GameManager = require(script.Parent.GameManager)
function NewPlayerJoined(Player)
local JoinData = Player:GetJoinData()
if JoinData then
print("JoinDataRetrieved") -- prints a table but there is nothing in it
for Index, Key in pairs(JoinData.TeleportData) do
print(Key)
end
print("what")
else
print("No JoinData Found :((")
end
GameManager.PlayerSetUp(Player)
end
function PlayerLeaving(Player)
end
PlayerService.PlayerAdded:Connect(NewPlayerJoined)
PlayerService.PlayerRemoving:Connect(PlayerLeaving)