Garry's Mod Wiki

NPC:Disposition

number NPC:Disposition( Entity ent )

Description

Returns the way the NPC "feels" about the entity.

Arguments

1 Entity ent
The entity to get the disposition from.

Returns

1 number
The NPCs disposition, see Enums/D.

Example

If a player is hurt by a friendly NPC, announce it.

function FriendlyFireAnnouncement( ply, atk ) if atk:IsNPC() and atk:Disposition(ply) == D_LI then --like PrintMessage("A "..atk:GetClass().." attacked "..ply:Nick().."!", HUD_PRINTTALK) end end hook.Add( "PlayerHurt", "FriendlyFire", FriendlyFireAnnouncement )
Output: Prints "A ____ attacked ____!" to everyones chat.

Page Links


Special Pages


Wikis

?

Render Time: 43ms

DB GetPage 6
Generate Html 4
SaveChanges (1) 19
Render Body 0
Render Sidebar 12