Gamemode.PlayerSpawnedNPC

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePlayerSpawnedNPC
SyntaxGM:PlayerSpawnedNPC( Player Entity, Npc Npc )
DescriptionCalled when a player spawned an NPC.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerSpawnedNPC]Gamemode.PlayerSpawnedNPC [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]

Examples

DescriptionPrints the model of the NPC to the player.
Used onNewerServer.png
Code
function NPCModel( pl, npc )
	pl:PrintMessage(HUD_PRINTTALK, "NPC Model: ".. npc:GetModel() );
end
hook.Add("PlayerSpawnedNPC", "NPCModel", NPCModel);
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox