Garry's Mod Wiki

ENTITY:PassesTriggerFilters

  boolean ENTITY:PassesTriggerFilters( Entity ent )

Description

Polls whenever the entity should trigger the brush.

This hook is broken and will not work without code below

Arguments

1 Entity ent
The entity that is about to trigger.

Returns

1 boolean
Should trigger or not.

Example

How this is supposed to work internally

ENT.Entities = {} function ENT:IsTouchedBy( ent ) return table.HasValue( self.Entities, ent ) end function ENT:StartTouch( ent ) if ( !self:PassesTriggerFilters( ent ) ) then return end table.insert( self.Entities, ent ) /* Code */ end function ENT:Touch( ent ) if ( !self:PassesTriggerFilters( ent ) ) then return end if ( !table.HasValue( ent ) ) then table.insert( self.Entities, ent ) end /* Code */ end function ENT:EndTouch( ent ) if ( !self:IsTouchedBy( ent ) ) then return end table.RemoveByValue( self.Entities, ent ) /* Code */ end