Teleport to Private Server Error

local TPPlayer = {}
		for i,v in pairs(script.Parent.Parent.AllPlayers:GetChildren()) do
			if game.Players:FindFirstChild(v.Name) then
				table.insert(TPPlayer, game.Players:FindFirstChild(v.Name))
			end
		end
		TPS:TeleportToPrivateServer(game.ServerStorage.PlaceGameId.Value, "hi" .. tostring(x + math.random(1,10000) * math.random(1,5)), TPPlayer)

When it teleports, it says ‘teleport failed due a unknown error’. Also x = 1 or 3, just trying to make a custom code every time. Anything helps - BMWLux

You have to use TeleportService:ReserveServer() to get an access code to the server, not make your custom own. I also strongly advice you use TeleportService:TeleportAsync() instead of TeleportService:TeleportToPrivateServer(). You can read about the suggested method here: TeleportService | Roblox Creator Documentation