ENT.PassesTriggerFilters

From GMod Wiki

Revision as of 03:16, 12 September 2011 by mrflippy (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NamePassesTriggerFilters
SyntaxENT:PassesTriggerFilters( Entity ent )
DescriptionReturn true if this entity should trigger the ENT.StartTouch/ENT.Touch/ENT.EndTouch functions. This is not called automatically.
ReturnsBoolean
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.PassesTriggerFilters]ENT.PassesTriggerFilters [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionOnly npc_zombies trigger our touch functions.
Used onNewerServer.png
Code
function ENT:PassesTriggerFilters(ent)
    return ent:GetClass() == "npc_zombie"
end
function ENT:StartTouch(ent)
  if(!self:PassesTriggerFilters(ent)) then return end
  --code goes here
end
 
OutputN/A


Additional Notes

This is not called automatically by the game engine. If you want to use this, you will need to call it yourself.

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox