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
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.
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.