I want to teleport players and i saw this Error in the Developer Console:
Teleport to ReservedServer failed : HTTP 504 (Gateway Time-Out)
But it should just give the pcall the error. Success1 should give me false but it didnt, instead gave me the Gateway Error. What did i do wrong with the PCall?
if #QuickMatch == 2 then
if lockedQuickMatch == false then
lockedQuickMatch = true
local reserveServer
local success1 = pcall(function()
reserveServer = teleportService:ReserveServer(matchGamePlaceId)
end)
if success1 == true then
local success2 = pcall(function()
teleportService:TeleportToPrivateServer(matchGamePlaceId, reserveServer, QuickMatch)
end)
if success2 == true then
for index, value in pairs(QuickMatch) do
table.insert(StartedMatch, value)
matchBegunRemoteEvent:FireClient(value)
end
elseif success2 == false then
for index, value in pairs(QuickMatch) do
playRemoteEvent:FireClient(value, "Failed Matchmaking")
end
end
elseif success1 == false then
for index, value in pairs(QuickMatch) do
playRemoteEvent:FireClient(value, "Failed Matchmaking")
end
end
table.clear(QuickMatch)
lockedQuickMatch = false
end
end
end
end
teleportService.TeleportInitFailed:Connect(function(player, teleportResult)
if teleportResult ~= Enum.TeleportResult.Success then
if table.find(CasualMatch, player) then
table.remove(CasualMatch, table.find(CasualMatch, player))
end
if table.find(QuickMatch, player) then
table.remove(QuickMatch, table.find(QuickMatch, player))
end
if table.find(StartedMatch, player) then
table.remove(StartedMatch, table.find(StartedMatch, player))
end
playRemoteEvent:FireClient(player, "Failed Matchmaking")
end
end)