I'm trying to match a group of players together and put them together in one place. However, when I try to receive information of the player joining the game, I receive this error: HTTP 500 (HTTP/1.1 500 User is offline)
I've used a bit from the Matchmaking tutorial on the roblox wiki in order to make this code and I understand most of it I think. I can't figure out why the user is apparantely offline though.
if #playernamelist > 1 and att.Value > 2 then
joinlist = {playernamelist[1], playernamelist[2]}
table.remove(playernamelist, 1)
table.remove(playernamelist, 1)
id = joinlist[1].UserId
local match = game:GetService("AssetService"):CreatePlaceAsync("2 player match", 243740040)
print(match)
wait(5)
local connection = joinlist[1].OnTeleport:connect(function(teleportState, placeId)
if teleportState == Enum.TeleportState.Started then
local teleportStarted = os.time()
-- Keep checking if playerA has arrived in other instance.
wait(3)
while true do
local success, error, placeId, arenaInstanceId = teleportService:GetPlayerPlaceInstanceAsync(id)
print(success)
print(error)
print(placeId)
print(arenaInstanceId)
-- If playerA is in the correct place then we can teleport playerB there as well
if placeId == 243740040 then
teleportService:TeleportToPlaceInstance(placeId, arenaInstanceId, joinlist[2])
return
end
wait()
end
end
end)
wait(1)
-- Teleport playerA to the arena
teleportService:Teleport(243740040, joinlist[1])
att.Value = 0
end
