Yuari
Documentation
Docs/Filter/AllFilter.new

AllFilter.new

AllFilter.new creates a filter that matches when every child filter matches.

Syntax

AllFilter.new(filters?: {FilterBase}) -> AllFilter

Parameters

ParameterTypeDescription
filters?{FilterBase}Optional array of filters combined with logical AND.

Returns

TypeDescription
AllFilterA composite filter that matches only when every child filter matches.

Description

AllFilter.new builds a composite filter from the filters in the optional array. When the routed function runs, every child is evaluated against the same arguments in order; the first child that fails stops evaluation and the call is routed to the original branch.

Children are stored by reference, so the composite keeps them alive for as long as it exists. Passing no filters produces a filter that always matches.

Example

local named = InstanceNameFilter.new(1, "Part")
local typed = InstanceTypeFilter.new(1, "BasePart")
local filter = AllFilter.new({ named, typed })
print(filter) -- AllFilter

Notes

  • hookfunction accepts a filter as an optional third argument; getfilter accepts one directly.
  • Every child must be a FilterBase value.
  • An empty AllFilter always matches.