NPC.SetTarget

From GMod Wiki

Jump to: navigation, search
Function
Syntax NPC:SetTarget( Entity Target )
Description:
Sets the target for the NPC. Used for some engine schedules.
Returns: nil
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.SetTarget]NPC.SetTarget [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the NPC's target to a player.
Used onNewerServer.png
Code
npc:SetTarget( player.GetByID(1) )
OutputThe NPC's target is now the first player.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox