NPC.AddRelationship
From GMod Wiki
This page has been deemed a mess. It may contain unnecessary information or be poorly organized. You can discuss changes on this article's talk page. |
Function | |
Syntax | NPC:AddRelationship( String relationstring ) |
Description: | |
Changes how an NPC feels towards another NPC. | |
Returns: | nil |
In Object: | Npc |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=NPC.AddRelationship]NPC.AddRelationship [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Make our NPC fear turrets. |
---|---|
Used on | |
Code | function makeNPCFearTurrets(NPC) NPC:AddRelationship("npc_turret_floor D_FR 99") end |
Output | The NPC will fear turrets. |
Description | Make our NPC hate players. |
---|---|
Used on | |
Code | function makeNPCHatePlayers(NPC) NPC:AddRelationship("player D_HT 999") end |
Output | The NPC will hate and attack players. |
Additional Notes
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