Garry's Mod Wiki

NPC:AddRelationship

NPC:AddRelationship( string relationstring )

Description

Changes how an NPC feels towards another NPC. If you want to setup relationship towards a certain entity, use NPC:AddEntityRelationship.

Arguments

1 string relationstring
A string representing how the relationship should be set up. Should be formatted as "npc_class Enums/D numberPriority".

Example

Spawns a manhack and makes it hate floor turrets.

local manhack = ents.Create( "npc_manhack" ) manhack:Spawn() manhack:AddRelationship( "npc_turret_floor D_HT 99" )

Page Links


Special Pages


Wikis

?

Render Time: 79ms

DB GetPage 40
Generate Html 9
SaveChanges (1) 15
Render Body 0
Render Sidebar 13