Gamemode.GUIMousePressed
From GMod Wiki
| Event Hook | |
| Hook Name | GUIMousePressed |
| Syntax | GM:GUIMousePressed( |
| Description | Called when the player presses a mouse button (when the cursor is visible). |
| Returns | Nil |
| Lua State | |
| BBCode | [b][url=wiki.garrysmod.com/?title=Gamemode.GUIMousePressed]Gamemode.GUIMousePressed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
function GM:GUIMousePressed(mc) if mc == MOUSE_LEFT then RunConsoleCommand("+attack") elseif mc == MOUSE_RIGHT then RunConsoleCommand("+attack2") end end
Allows you to shoot when you press the mouse buttons when in GUI mode.
Additional Notes
- See MouseCode for the values that are passed to this function.