ENTITY:CanTool
Description
Controls if a tool can be used on this entity or not.
This hook will only work in Sandbox derived gamemodes that do not have SANDBOX:CanTool overridden.
This hook will work on ALL entities, not just the scripted ones (SENTs)
Arguments
2 table with TraceResult structure tr
The trace of the tool.
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.Returns
Example
Prevents usage of the remover tool on this entity.
Garry's Mod
Rust
Steamworks
Wiki Help