So I have this folder in workspace called InslandSlots and each slot it has a model called Island.
After each round I wan't it to destroy() the model but I keep getting the error: ServerScriptService.Rounds:15: attempt to index a nil value
Server Script:
wait()
while true do
--Preparing round
Status = "PREPARING ROUND"
UpdateStatus:FireAllClients(Status)
local Islands = game.Workspace.IslandSlots:GetChildren()
for i = 1, #Islands do
local Island = Islands[i]
Island:FindFirstChild("Model"):Remove()
wait()
end
wait(10)
end```

2 comments
This might not be helpful, so I'm not making it an answer, but normally for tables I use for i, var in ipairs(table) do as it automatically just cycles through the table. You then wouldn't have to use Islands[i], as var would already carry the same value that that would. I honestly don't see any problems other than that, except for the infinite loop created by while true do, when this seems to hap
pen only once, but this could just be because I don't know the full scope of the script.