Script:
local m = game.Players.LocalPlayer.leaderstats.Experience.Value while true do script.Parent:Clone().Parent = script.Parent.Parent wait(3) if m >= 5 then script:Destroy() end end
The :Destroy() thing doesn't work, so how do I stop it when m is greater or equal than 5. It would be nice if you would give me the code with your answer if you have one.
To stop a while true do, you should use break
while true do script.Parent:Clone().Parent = script.Parent.Parent wait(3) if m>=5 then break end end
I honestly never have tried doing this, so, I apologize greatly if it doesn't work.
local SomethingIsWrong = true
while true do print("Something") if SomethingIsWrong then break end end
instead of doing "while true" do something like this..
local running = true while running do script.Parent:Clone().Parent = script.Parent.Parent wait(3) if m > 5 then running = false end end
Also your problem could be that you are cloning the script and each script is cloning itself. So maybe try not to clone the scripts.