of     1   

IthacaMedia
#152469740Friday, December 26, 2014 2:26 PM GMT

How do I keep track of both when the player clicks the mouse, and when they hold it down?
championbuilder
#152469842Friday, December 26, 2014 2:29 PM GMT

Here's how to detect both. mouse.Button1Down:connect(function() print("holding mouse") end) mouse.Button1Up:connect(function() print("let go of mouse (click)") end)
IthacaMedia
#152469943Friday, December 26, 2014 2:32 PM GMT

Oh thanks lol, got used to mouse.Button1Click events xD.
IthacaMedia
#152469999Friday, December 26, 2014 2:34 PM GMT

But wait, if they hold it down for a fraction of a second, will still count as holding mouse.
championbuilder
#152470539Friday, December 26, 2014 2:50 PM GMT

mouse.Button1Down:connect(function() click = true --Detect if clicked print("click") wait(1) --Wait to detect if holding if click == true then click = false --If is holding then click becomes nil print("holding") --Where your code goes for what should happen if you're holding down mouse hold = true --Make holding true end end) mouse.Button1Up:connect(function() if click == true then print("click bye") --Where your code goes for what should happen if you lift mouse with click (Leave empty if nothing) click = false elseif hold == true then print("hold bye") --Where your code goes for what should happen if you lift mouse with hold (Leave empty if nothing) hold = false end end)
Bebee2
#152471225Friday, December 26, 2014 3:08 PM GMT

-- Least lines and it doesn't fire if someone spams click which may trigger mouse hold. holdspeed = 0.2 mouse.Button1Down:connect(function() local bool delay(holdspeed, function() if not bool then print'holding' end end) mouse.Button1Up:wait() print'released' bool = true end)
Dominical
#152471962Friday, December 26, 2014 3:25 PM GMT

This may or may not help you depending on your knowledge, but make a Timer with the Button1Down event.
IthacaMedia
#152481621Friday, December 26, 2014 6:20 PM GMT

Ok thanks for the help.

    of     1