NPC.AddEntityRelationship
From GMod Wiki
Revision as of 16:29, 28 April 2010 by Crazy Quebecer (Talk | contribs)
Function | |
Syntax | NPC:AddEntityRelationship( Entity target, Enum disposition, Integer priority ) |
Description: | |
Makes the NPC like, hate, feel neutral towards, or fear the entity in question. Priority is how strongly the entity feels towards it, and disposition corresponds to a disposition enumeration. | |
Returns: | nil |
In Object: | Npc |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=NPC.AddEntityRelationship]NPC.AddEntityRelationship [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Spawns a manhack and makes it fear player 1. |
---|---|
Used on | |
Code | local hack = ents.Create("npc_manhack") hack:Spawn() hack:AddEntityRelationship(player.GetByID(1), D_FR, 99 ) |
Output | N/A |
Additional Notes
Disposition
An NPC's disposition is the way it feels about another entity.
A list of disposition enumerations from the file:
D_ER = 0 // Undefined - error D_HT = 1 // Hate D_FR = 2 // Fear D_LI = 3 // Like D_NU = 4 // Neutral