Garry's Mod Wiki

ENTITY:CanTool

boolean ENTITY:CanTool( Player ply, table tr, string tool )

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

1 Player ply
Player, that tried to use the tool
2 table tr
The trace of the tool. See TraceResult.
3 string tool
Class of the tool that is tried to use, for example - weld

Returns

1 boolean
Return false to disallow using that tool on this entity, return true to allow.

Page Links


Special Pages


Wikis

?

Render Time: 78ms

DB GetPage 42
Generate Html 9
SaveChanges (1) 13
Render Body 0
Render Sidebar 12