So I’m trying to make a queueing system for a horror game, but it keeps saying,
“Invalid player to teleport. The invalid instance name is Werx7499.”
Here is the code:
local TeleService = game:GetService("TeleportService")
local PlaceId = 135278317068582
script.Parent.CountDown.Start.Event:Connect(function()
local Players = {}
for i, Plr in ipairs(script.Parent.Parent.Player:GetChildren()) do
table.insert(Players, Plr)
end
local ServCode = TeleService:ReserveServer(PlaceId)
TeleService:TeleportToPrivateServer(PlaceId, ServCode, Players)
end)
You must pass an array filled with the actual player objects, you are passing (what I assume to be) their characters.
local PlayersService = game:GetService("Players")
for i, Plr in ipairs(script.Parent.Parent.Player:GetChildren()) do
table.insert(Players, PlayersService:GetPlayerFromCharacter(Plr))
end