Garry's Mod Wiki

Revision Difference

Player:GetActiveWeapon#512598

<function name="GetActiveWeapon" parent="Player" type="classfunc">⤶ <description>Returns the player's active weapon.</description>⤶ <realm>Shared</realm>⤶ <rets>⤶ <ret name="" type="Weapon">The weapon the player is currently has equipped.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Prints the player's active weapon's class name.</description>⤶ <code>print(Entity( 1 ):GetActiveWeapon():GetClass())</code>⤶ <output>The active weapon's class. For example, if you are holding the tool gun then this will be "gmod_tool".</output>⤶ ⤶ </example>