Im having an error in my code where I try to teleport a group of people using TeleportAsync() (not teleportpartyasync) and it errors because i am teleporting more than one person, and it says “TeleportPartyAsync error: Doesn’t support a guest”
error:
My script:
local teleportservice = game:GetService("TeleportService")
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local humanoid = hit.Parent.Humanoid
local colony = hit.Parent.Colony
local arrayofplayers = {
}
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character:WaitForChild("Colony").Value == colony.Value and colony.Value ~= "" then
table.insert(arrayofplayers, v)
elseif v.Character.Name == hit.Parent.Name then
teleportservice:Teleport(98985454249054, game.Players:GetPlayerFromCharacter(hit.Parent))
print("teleported one player not in a colony")
end
end
teleportservice:TeleportAsync(98985454249054, arrayofplayers)
end
end)
Studio so i can get more than one player in the same server with the local test thing, i know it wont teleport but im looking at the error and it should say you cant teleport in studio instead of doesnt support a guest