NPC.AddEntityRelationship

From GMod Wiki

Jump to: navigation, search
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: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.AddEntityRelationship]NPC.AddEntityRelationship [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSpawns a manhack and makes it fear player 1.
Used onNewerServer.png
Code
local hack = ents.Create("npc_manhack")
hack:Spawn()
hack:AddEntityRelationship(player.GetByID(1), D_FR, 99 )
OutputN/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
 

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox