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

[SOLVED] How to fix a script that will increase value and deletes/disables if reach to 1000?

Asked by
5y5sy 0
3 years ago
Edited 3 years ago

i already tried to make this:

local Temp = game.Workspace.Temp
local TempValue = game.Workspace.Temp.Value

while true do

    wait()

    Temp.Value = Temp.Value + 1

    if  TempValue >= 1000 then
        script:Destroy()

    end
end

Increasing is working perfectly fine, but it doesn't stop if reaches 1000.

Changing Script:Destroy() to script.Disabled = true does not work.

There is a way to fix this?

EDIT: i changed script:Destroy() into break which is fixed.

Answer this question