Whenever I try to run the script, the output just says "ServerScriptService.Script:14: attempt to index field '?' (a nil value)" I don't know what's happening, because if I remove the CFrame, the output just says "expecting CFrame". Help?
local MapsLocation = ServerStorage:WaitForChild("Maps")
local plrs = {}
local GetMaps = MapsLocation:GetChildren()
local MapToAppear = GetMaps[math.random(1, #AVMaps)]
local MapCloned = MapToAppear:Clone()
MapCloned.Parent = game.Workspace
local SpawnBricks = MapCloned:FindFirstChild("Spawn")
local SpawnsToTeleport = SpawnBricks:GetChildren()
wait(3)
for i, plr in pairs(plrs) do
if plr then
char = plr.Character
if char then
char:FindFirstChild("HumanoidRootPart").CFrame = SpawnsToTeleport[1].CFrame
table.remove(SpawnsToTeleport, 1)
end

3 comments
try printing spawnstoteleport[1] and see what you get
Prints nil (already tried that earlier), but the problem is that if i remove the [1], it will give an error ("bad argument #3, expecting CFrame)
if its printing nil your table probably doesnt have anything in it, so obviously it cant get cframe information from nothing.