NPC.Give
From GMod Wiki
Function | |
Syntax | NPC:Give( String item ) |
Description: | |
Give the NPC an item. | |
Returns: | Entity |
In Object: | Npc |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=NPC.Give]NPC.Give [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This example will give the NPC a crowbar. |
---|---|
Used on | |
Code | NPC:Give("weapon_crowbar") |
Output | N/A |
Additional Notes
- NPC:SetKeyValue( "additionalequipment", "weapon_ar2" ) will give you much better results.
- Used to give a scripted NPC a weapon.
- This function is case sensitive. Weapon_Crowbar will not be the same as weapon_crowbar.
- The item can be any of the default items supplied with the game (weapon_crowbar, weapon_stunstick, weapon_physcannon, weapon_physgun, weapon_pistol, weapon_357, weapon_smg1, weapon_ar2, weapon_shotgun, weapon_crossbow, weapon_annabelle, weapon_frag, weapon_rpg, weapon_slam, weapon_bugbait, item_ml_grenade, item_ar2_grenade, item_ammo_ar2_altfire, item_healthkit, item_healthvial, item_suit, item_battery, gmod_camera, gmod_tool) or a SWEP.