What did I do wrong here?

I was trying to make a script when a value reaches it’s number it would do an event or something like that.
image
image

Do you want the script to stop working?

Also, you could use .Changed event instead of a loop.
[Meaning]:

script.Parent.Value.Changed:Connect(function(newvalue)
    if newvalue >= 11 then
       print("working")
    else
       print("not working")
       script.Disabled = true
    end
end)

Do you have any other running scripts that related to this?

1 Like

You are checking when the value is greater than 11. If you want the event to start when the value is at 11, do this on line 3:

if script.Parent.Value >= 11 then

As @Valkyrop said, you could use a .Changed event. I find it better than using a loop.
If the value changes rapidly, you can stick to the loop or find something else more efficient.

1 Like

Hey, @livingblu @Valkyrop For some reason after I replaced the script I don’t get anything from the output?

If you’re using the .Changed event, the value must change in order for it to fire. Try changing the value using the server and view the output.

image
I’ve done many way’s to set it’s value and I still don’t get anything.

You can try setting the value through the console.

If that doesn’t work, use your original script and just change line 3 to what I offered.

Thank you, I am just brain Dead right now in this time and I am trying to finish this project before I sleep.