Garry's Mod Wiki

Revision Difference

ENTITY:CanTool#528868

<function name="CanTool" parent="ENTITY" type="hook">⤶ <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 <page>SANDBOX:CanTool</page> overridden.⤶ ⤶ <note>This hook will work on ALL entities, not just the scripted ones (SENTs)</note>⤶ </description>⤶ <realm>Shared</realm>⤶ <predicted>No</predicted>⤶ <file line="73">gamemodes/sandbox/gamemode/shared.lua</file>⤶ <args>⤶ <arg name="ply" type="Player">Player, that tried to use the tool</arg>⤶ <arg name="tr" type="table">The trace of the tool. See <page text="TraceResult">Structures/TraceResult</page>.</arg>⤶ <arg name="tool" type="string">Class of the tool that is tried to use, for example - `weld`</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">Return `false` to disallow using that tool on this entity, return `true` to allow.</ret>⤶ </rets>⤶ </function>⤶ ⤶