Script:
1 | local m = game.Players.LocalPlayer.leaderstats.Experience.Value |
2 |
3 | while true do |
4 | script.Parent:Clone().Parent = script.Parent.Parent |
5 | wait( 3 ) |
6 | if m > = 5 then |
7 | script:Destroy() |
8 | end |
9 | 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
1 | while true do |
2 | script.Parent:Clone().Parent = script.Parent.Parent |
3 | wait( 3 ) |
4 | if m> = 5 then |
5 | break |
6 | end |
7 | end |
I honestly never have tried doing this, so, I apologize greatly if it doesn't work.
local SomethingIsWrong = true
1 | while true do |
2 | print ( "Something" ) |
3 | if SomethingIsWrong then |
4 | break |
5 | end |
6 | end |
instead of doing "while true" do something like this..
1 | local running = true |
2 |
3 | while running do |
4 | script.Parent:Clone().Parent = script.Parent.Parent |
5 | wait( 3 ) |
6 | if m > 5 then |
7 | running = false |
8 | end |
9 | 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.