In a script I made, people were supposed to spawn in random spawns, it should be working but the output is saying that it isn't.
Variable
spawns = game.Workspace.Spawns:FindFirstChild("Play" .. tostring(math.random(1, 6)))
9 lines down
For statement using Variable
for i,v in pairs(game.Players:GetPlayers()) do
v.Character:MoveTo(spawns.Position)
end
There are multiple spawns in a model inside workspace, all players are supposed to spawn in one of them each. So I used a for statement to get it random.
Output
Workspace.Game:11: attempt to index global 'spawns' (a nil value)

3 comments
So, tell me if I'm correct. There is a model in Workspace called 'Spawns' (exactly spelt like that) and in 'Spawns' there are 10 spawns named 'Play1', 'Play2', 'Play3', 'Play4' or are they all named 'Play'?
Wait a minute.
Changed the 10 to a 6 and they are all named "Play"