Garry's Mod Wiki

Revision Difference

NPC:SetCurrentWeaponProficiency#510486

<function name="SetCurrentWeaponProficiency" parent="NPC" type="classfunc">⤶ <description>Sets the weapon proficiency of an NPC (how skilled an NPC is with its current weapon).</description>⤶ <realm>Server</realm>⤶ <args>⤶ <arg name="proficiency" type="number">The proficiency for the NPC&#x27;s current weapon. See &lt;page&gt;WEAPON_PROFICIENCY&lt;/page&gt;.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Makes all NPCs suck at using their current weapons.</description>⤶ <code>⤶ for _, v in pairs( ents.FindByClass( "npc_*" ) ) do⤶ v:SetCurrentWeaponProficiency( WEAPON_PROFICIENCY_POOR )⤶ end⤶ </code>⤶ ⤶ </example>