Before starting, I want to say my Experience is public and the places inside of it are also public. I have gone in and used Publish As in order to republish each individual place to where it needs to be, and have extensively tested to make sure each place is public. This is NOT the problem, please do not suggest setting the Place/Experience as Public.
I am using TeleportAsync in order to teleport a single player or multiple players into a new, reserved place. For some reason when teleporting multiple players, it will teleport the first player fine and then error out for the second player. The error I am getting is: “Teleport failed because Unable to join Game 512 (Unauthorized)”. The 3 digits after Game is sometimes different.
Every single question I’ve come across from teleportAsync bugging out is people forgetting to set their place to public, or some other issue that is easily resolved. That is NOT the issue I am having.
Multiplayer Teleport Code:
ReplicatedStorage.MultiplayerRemoteEvent.OnServerEvent:Connect(function(player, playerRating)
if MatchmakingQueues:FindFirstChild(player.Name) then return end
local HasFoundMatch = nil;
for i, playersInQueue in pairs(MatchmakingQueues:GetChildren()) do
if math.abs(playersInQueue.Rating.Value - playerRating) <= 100 or math.abs(playerRating - playersInQueue.Rating.Value) <= 100 then
HasFoundMatch = playersInQueue.Value;
playersInQueue:Destroy();
end
end
if HasFoundMatch ~= nil then
local playersToTeleport = {HasFoundMatch, player};
ReplicatedStorage.FoundMatchEvent:FireClient(player, HasFoundMatch);
ReplicatedStorage.FoundMatchEvent:FireClient(HasFoundMatch, player);
local teleportOptions = Instance.new("TeleportOptions");
teleportOptions.ShouldReserveServer = true;
teleportOptions:SetTeleportData("Multiplayer");
TeleportService:TeleportAsync(12332653401, playersToTeleport, teleportOptions);
else
--Code for creating a new party instance, works fine and doesn't matter in this context
end
end)
When starting a single player session using
for i, v in pairs(MatchmakingQueues:GetChildren()) do
v.TimeOut.Value -= 1;
if v.TimeOut.Value <= 0 then
ReplicatedStorage.FoundMatchEvent:FireClient(v.Value, nil);
v:Destroy();
local teleportOptions = Instance.new("TeleportOptions");
teleportOptions.ShouldReserveServer = true;
teleportOptions:SetTeleportData("Bots");
TeleportService:TeleportAsync(12332653401, {v.Value}, teleportOptions);
end
end
It works, however after one player starts a single player game, no other player can teleport, and the console says the same error.
Any and all help is appreciated!