NPC:Disposition
Description
Returns the way the NPC "feels" about the entity.
Arguments
Returns
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.