Hook filters
Build matching rules for hooked calls with ten Kawaii filter constructors. Combine argument values, types, counts, caller identity, Instance classes, and namecall methods, then pass a filter to hookfunction, hookmetamethod, or oth.hook. A matching call reaches the replacement; other calls continue to the preceding function.
Functions
AllFilter.newMatch a hooked call only when every child filter matches. Use it when several conditions must hold together, such as a particular argument value and Instance class.
AnyFilter.newMatch when at least one child filter matches. Use it to allow several independent cases without installing separate hooks.
ArgCountFilter.newMatch calls with exactly a given number of arguments. This is handy when an overloaded callback uses the number of supplied values to distinguish one form of a call from another.
ArgumentFilter.newMatch a call when one argument equals an expected value. Use it to limit a hook to calls with a known marker, receiver, or other argument.
CallerFilter.newMatch a call by where it originated. Use the default to handle executor-originated calls, or invert it when a hook should handle calls from game code instead.
InstanceTypeFilter.newMatch when an argument is a Roblox Instance with one exact class name. Use it when a hook should handle a specific class of receiver or argument.
NamecallFilter.newMatch a namecall only when its current method name equals the supplied name. Use it with an argument filter when the same namecall hook should handle one method on one receiver.
NotFilter.newMatch when one valid child filter does not match. Use it to exclude a specific value or condition from a broader hook.
TypeFilter.newMatch a hooked call when one argument has a particular basic Luau type. This is useful when a shared function accepts several kinds of input and you only want to inspect or change one of them.
UserdataTypeFilter.newMatch userdata with the same VM class tag as an example value. Use this to distinguish Roblox userdata kinds when the basic "userdata" type would admit too many unrelated values.