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

Why my check if available click is more than 0 not work? I got -1

Asked by
EteraW 77
5 years ago

I just try if Click Available is more than 0 , it will add 1 score. It should be 0 but I got -1.

Here is button script.

script.Parent.MouseButton1Click:Connect(function()
    if script.Parent.Parent.TextLabel.Value.Value >0 then
        script.Parent.Parent.TextLabel.Value.Value = script.Parent.Parent.TextLabel.Value.Value - 1
    end
end)

And here is script that set text to click available

while true do
    script.Parent.Text = "Click available: "..script.Parent.Value.Value
wait()
end

I have a NumberValue in TextLabel. Its name is "Value"

0
You are - 1 from the value. Also do not use loops there is the changed event or even beter just update the text in the click function User#5423 17 — 5y
0
@kingdom5 I try :GetPropertyChangedSignal("Value") but still not work. EteraW 77 — 5y
0
Sorry i forgot that I got -1 when I use macro and ping is 300+ I think it is because the lag. EteraW 77 — 5y

Answer this question