Garry's Mod Wiki

NPC:Disposition

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: 32ms

Session 0
DB GetPage 6
Generate Html 2
SaveChanges 10
Render Body 0
Render Sidebar 12