THIS QUESTION HAS BEEN SOLVED
Information:
- I am getting an error on line 5. The error is "Script timeout: exhausted allowed execution time"
- I am trying to do a coin spawning script
- I want to spawn 5 coins when no coins can be found in game.Workspace.Coins
- I am cloning from game.ReplicatedStorage.Coins
- The name of the coins are "Coin"
Script:
while true do
local c = game.Workspace.Coins:FindFirstChild("Coin")
if not c then
wait()
for i,coin in pairs(game.ReplicatedStorage.Coins:GetChildren()) do
local clone = coin:Clone()
clone.Parent = game.Workspace.Coins
end
end
end

1 comment
when doing while true do you need a wait() that will always happen