New here, hoping you get help me out. Before I paste the code I would like to give you a run down of what I am trying to do.
I have a Model in ServerStorage that is to get copied and placed into Workspace, after it is moved to Workspace, the code will check for certain conditions and then move the player(s) to a certain brick named "SpawnPoint" that is inside that newly moved Model. However, I keep getting the error attempt to index a nil value
models = game.ServerStorage.blah:GetChildren()
function movemodel()
t = models[math.random(1, #models)]:clone()
t.Parent = game.Workspace
end
while true do wait()
wait()
movemodel()
wait(5)
for i, v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == BrickColor.new("Bright yellow") then
v.Character.Torso.CFrame = game.Workspace:FindFirstChild("SpawnPoint").CFrame + Vector3.new(0,3,0)
end
end

2 comments
To demonstrate how I have it organized its Workspace > MODEL > SpawnPoint the main issue is that the MODEL is chosen with several other MODELS at random and each MODEL has a different name. So I can't simply put game.Workspace.MODELNAMEHERE.SpawnPoint as I won't know the MODEl name. I thought FindFirstChild would look everywhere in Workspace for the first child/brick named SpawnPoint?
Actually, yes, it can. If you pass 'true' to FindFirstChild as second argument, it will look recursively through the all the children and grand-children of the container you specified.