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

How do you detect mouse up ANYWHERE?

I'm making a tool that does something when you start holding down the left mouse button, and stops when you release the button.. I have it so it stops if you switch windows, let go, start typing, or press esc, pretty much everything covered, except for 1 thing..

If you release the mouse button over someone's name on the leaderboard, or some other gui button it doesn't detect the mouse up, any ideas how to get around this?

1 answer

✓ Accepted answer

You will have to use user input instead of keydown and keyup events because that won't work everywhere, what will is the userinput script, this comes from the roblox wiki:


function onKeyPress(inputObject, gameProcessedEvent)
	if inputObject.KeyCode == Enum.KeyCode.R then
		print("R was pressed")
	end
end

1 comment

1

you forgot to add the event to the function ^^

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