Hello i am making a horror game with a roblox friend and making some good progress. However, i have encountered a problem with the teleportation side of things. I am wanting to use the ReserveServer property to make it so when players are in, noone else can get into that server. As of so far i have this code:
local plrQuantity = script.Parent.Values.plrQuantity
local Players = script.Parent.Players
local TeleportService = game:GetService("TeleportService")
local Place = 2060347621 -- Main Game
local MinimumPlayers = 1
while true do
wait()
if plrQuantity.Value >=MinimumPlayers then
print("Enough Player to start.")
wait(5)
if plrQuantity.Value >=MinimumPlayers then
local code = TeleportService:ReserveServer(Place)
print("Teleporting Players")
for name, child in pairs(Players:GetChildren()) do
local temp = game.Players:GetUserIdFromNameAsync(child.Name)
local plr = game.Players:GetPlayerByUserId(temp)
--local plr = game.Players:GetPlayerFromCharacter(child)
TeleportService:TeleportToPrivateServer(Place,code,plr)
plrQuantity.Value = 0
for name, child in pairs(Players:GetChildren()) do
child:Destroy()
end
end
end
end
end
But i get errors in-game saying: "Unable to cast value to Objects" -- line 24 If anyone knows how to fix this I'd very much appreciate help. Thanks. BTW: "local Players = script.Parent.Players" is not the game.Players Service its a folder containing String values of usernames.

2 comments
Also, wont this tp all players? Because i'd only want it to TP the players who have entered the queue.
in this case you would need to make your own array of players that are in the queue and exclude the other players.