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

What script to do for a click counter?

Asked by 10 years ago

So I want to have a surface GUI that when I click a button on it, it changes the 'value' of my screen gui.

If I click Economy Passenger, if I go to my screen gui it will have economy passenger 1/20 and if I click it again it will say 2/20. I also want it to have a maximum, so If I click it 21 times it will only say 20/20 not 21/20.

Another thing is, what would the script for a GUI button to reset it to 0/20.

Thank Kieran

1 answer

Log in to vote
0
Answered by
Vathriel 510 Moderation Voter
10 years ago

This is the basis, but I'll leave it to you to figure out how to integrate it with your other scripts.

Clicks = 0

ClickDetector.Clicked:connect(function()
    if Clicks<20 then
        Clicks = Clicks+1
    else
    end
end)

Ad

Answer this question