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

How to make a button click count?

Let's say

local TD = 0

when the player pressed the button, 1 is added to TD and now

local TD = 1

if you press the button a second time, then 1 more will be added and then

local TD = 2

it seems easy, but I don’t know how to make a counter

1 answer

✓ Accepted answer

Well, this is essantailly just logic, you can think about it, have an event to detect if we pressed, than add 1 to that variable, like this TD = TD + 1, realy what we are saying here is, set TD to whatever TD and add 1 to it. So yeah it is easy to understand this mechanism

local TD = 0

clickDetector.MouseClick:Connect(function()
	TD = TD + 1
end)

3 comments

0

I was about to answer, but you already gave the answer hehe.

0

Sorry :)

0

Thanks

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