ENT.OnCondition

From GMod Wiki

Revision as of 19:42, 13 November 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameOnCondition
SyntaxENT:OnCondition( Enum ConditionID )
DescriptionIs called each time the NPC updates its conditions.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.OnCondition]ENT.OnCondition [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis checks for the condition
Used onNewerServer.png
Code
function ENT:OnCondition( iCondition )
 
 
	if self:ConditionName(iCondition) == "COND_SEE_PLAYER" then		
 
		print("NPC sees Player")
 
	end
 
 
	--Msg( self, " Condition: ", iCondition, " - ", self:ConditionName(iCondition), "\n" )
 
end
OutputN/A


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox