SANDBOX:CanTool
This hook is predicted. This means that in singleplayer, it will not be called in the Client realm.
Description
Called when a player attempts to fire their tool gun. Return true to specifically allow the attempt, false to block it.
Arguments
2 table with TraceResult structure tr
A trace from the players eye to where in the world their crosshair/cursor is pointing.
Returns only Entity when the 5th argument returns
45 number button
The tool button pressed.
- 1 - left click
- 2 - right click
- 3 - reload
- 4 - Menu (No interaction with the toolgun)
The number
4 is a test that Rubat is conducting to implement the CanTool in the SpawnMenu. It may disappear.
Garry's Mod
Rust
Steamworks
Wiki Help