Hey everyone! So I have this script, which will teleport all the players to the map. I'm selecting a random spawn for the player to spawn at. There is one issue. When I run the :GetChildren function on the spawns folder inside the map, it returns 0. No, i'm not stupid having 0 items in the folder.
Calling the function:
local map = game.Workspace.Map
teleportPlayers(contestants,map.Spawns:GetChildren())
The "teleportPlayers" function:
local function teleportPlayers(availablePlayers,spawns) -- both are tables
for _, player in pairs(availablePlayers) do
if player.Character then
if player.Character:FindFirstChild("HumanoidRootPart") then
player.Character.HumanoidRootPart.CFrame = spawns[math.random(1,#spawns)].CFrame + Vector3.new(0,5,0)
end
end
end
end
Even though I have tons of scripting knowlage, I for some reason don't know how to solve this. Please help lol

1 comment
can you insert all of your script?