Hello, so I am trying to make something in a tool that tells you for how long the left mouse button was pressed. The only idea I could come up with was to make a loop that activates on the Mouse.Button1Down event and counts in 0.1 seconds. Then I would break that loop and just use the information that I got in the Mouse.Button1Up part. However I can't break the loop. So, any better ways of doing this or just a way to break the loop when the left button goes up?

5 comments

0

I'd look into using tick() for getting the time between click and .... "unclick" ... could also use os.time() but i don't think that is necessary due to you not needing accurate times

0

Would you want the count to display as well?

0

@ForeverBrown yeah that part isn't the problem i just got a variable named timer and then did a loop with wait(0.1) and timer = timer + 1

0

@spot6003 Do you mean like print? Anyways i just need the end resoult of how long the button was held down to use in the mouse.Button1Up part

0

Like as a display for the people to see