• Right clicking
    8 replies, posted
[lua] icon.OnMousePressed = function() [/lua] That's when left clicking on the object. Is there a right click function? e.g. [lua] icon.OnRightMousePressed = function() [/lua] [editline]01:14AM[/editline] That didn't work, any other suggestions? :l
secondaryfire or something. [highlight](User was banned for this post ("Can't help? Don't reply." - mahalis))[/highlight]
[QUOTE=dill6869;20262009]secondaryfire or something. [highlight](User was banned for this post ("Can't help? Don't reply." - mahalis))[/highlight][/QUOTE] Lol, pwned. And yeah, i have always wondered. I cant remember if anything was on the wiki, but try there if you haven't?
[url]http://wiki.garrysmod.com/?title=Input.IsMouseDown[/url] i will keep looking. i used it before.
OnMousePressed takes a mouse enum as the first argument, just check if it is equal to MOUSE_RIGHT. [lua]icon.OnMousePressed = function(s, mc) if mc == MOUSE_RIGHT then -- code here end end[/lua]
[QUOTE=MakeR;20264498]OnMousePressed takes a mouse enum as the first argument, just check if it is equal to MOUSE_RIGHT. [lua]icon.OnMousePressed = function(mc) if mc == MOUSE_RIGHT then -- code here end end[/lua][/QUOTE] Wouldn't the first argument be the icon if you do it like that?
[QUOTE=CapsAdmin;20265334]Wouldn't the first argument be the icon if you do it like that?[/QUOTE] Why yes it would.
[QUOTE=dill6869;20262009]secondaryfire or something. [highlight](User was banned for this post ("Can't help? Don't reply." - mahalis))[/highlight][/QUOTE] wow funny jus cus u have no friends irl Thanks MakeR.
No problem.
Sorry, you need to Log In to post a reply to this thread.