Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Model doesn't have children but script doesn't recognize it?

Asked by
Oxprem 140
2 years ago

Hello, so, I am working on a game with a bunch of different maps, and in this map, there is a model where a bunch of coins are. When the coins get collected, they are destroyed and are no longer a child of the model. However, when there are no more coins in the model, it doesn't not seem to recognize it and it does not clone a new set of coins.

Script (Its a server script):

repeat 
    wait(1) 
until #script.Parent.Model:GetChildren() == 0
local winner = game.ReplicatedStorage.Variables.Winner
game.ReplicatedStorage.ObbyChaosCoins:Clone().Parent = workspace[winner.Value]
script.Parent:Destroy()

Answer this question