Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What script to do for a click counter?

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.