Issue that I had - Thing wouldn't destroy, this was the problem code -
local rounddeciders2 = game.Lighting.rounddeciders local rounddeciders = game.Workspace.rounddeciders while true do wait(2) rounddeciders:Destroy() print('round begin') wait(2) rounddeciders2:Clone().Parent = game.Workspace print('round over') end
I had to get rid of the first two variables, which meant it looked like this -
while true do wait(2) game.Workspace.rounddeciders:Destroy() print('round begin') wait(2) game.Lighting.rounddeciders:Clone().Parent = game.Workspace print('round over') end
Thanks for helping, ioutragous.
Your script works only once because, once the rounddeciders
you give the script gets destroyed, and it never refreshes to the new one because it tries to Destroy()
the first rounddeciders
you showed it.
Solution: Move line 3 to line 6, or just anywhere in front of while true do
and behind rounddeciders:Destroy()
local rounddeciders2 = game.ServerStorage.rounddeciders --There's ServerStorage for your thing, use it. while true do local rounddeciders = workspace.rounddeciders --You can refer to game.Workspace as workspace wait(2) rounddeciders:Destroy() print('round begin') wait(2) rounddeciders2:Clone().Parent = workspace print('round over') end
P.S. Guess ioutrageous fixed your script out of SH. His solution is of course correct. You don't need to get rid of the variables if you don't want to, however - just remember the variables only update when you call them. You only call rounddeciders
and rounddeciders2
once, so they always refer to the item which exists at first - that is why the script did not Destroy()
.
Instead of :Destroy()
try using :remove()
Hope this help! :D if it still doesn't work please leave a comment!