Was wondering what was the best method for making a combo system?
Example: Everytime you press the left mouse button, the console will print(x), x in this case is the number of times you pressed the left mouse button, however if you don't press it in a certain amount of time x resets back to 1.
Sorry if it's hard to understand, was just looking for a good method.
Thank you.
Decide if it's the first time when it happens. This is as simple as remembering when it happened, and simply checking if it happened recently enough for you.
local time,x = 0,0 Mouse.MouseButton1Click:connect(function() local now = tick() if time + 5 > now then -- Last time was less than 5 seconds ago? x = x+1 else x = 1 end print(x) time = now end)