HTTP 400 on teleport?

Why do I get HTTP 400 bad request when I try to teleport?
I’ve tried some debugging but I don’t know how to fix it.
And no, the placeid is not invalid!

Code:

local function teleportPlayers(car)
	if #players > 0 then
		teleporting = true
		status.Text = "TELEPORTING"
		
		local playersToTeleport = {}
		
		for i = 1, #players do
			if game.Players:findFirstChild(players[i]) then
				table.insert(playersToTeleport, game.Players:findFirstChild(players[i]))
			else
				table.remove(players, i)	
			end
		end
		
		teleporting = true
		print("Yes")
		local code = game:GetService("TeleportService"):ReserveServer(6486584798)
		print("YEs")
		game:GetService("TeleportService"):TeleportToPrivateServer(6486584798, code, playersToTeleport)
		print("YES")
		
		repeat wait() until #players <= 0
		updateUI()
		teleporting = false
	end
end

Is this happening only in Roblox Studio? You cannot Teleport in Roblox Studio.

It is not happening in Roblox Studio.

Instead of having these numbers on both teleport and reserve try. game.PlaceId

I can do that, the current place and the place I try to teleport to is two different games.

You have to be in the place you want to ReserveServer for in order for it to work. You can’t be in a different place and then reserve a server for a different place.

But how would I teleport people from the lobby to the real game?

Teleport them to the real game, then teleport them to the ReservedServer.

Will everyone that I teleported get to the same game?

I believe so, another alternative is you can use the real game as the main, but have settings to load respective maps, so like if it isn’t a private server you load the hub map.

I don’t know what I did to fix it but it finally worked!