Yuari
Documentation
Docs/Filter/InstanceNameFilter.new

InstanceNameFilter.new

InstanceNameFilter.new creates a filter that checks an Instance name.

Syntax

InstanceNameFilter.new(argument_index: number, instance_name: string) -> InstanceNameFilter

Parameters

ParameterTypeDescription
argument_indexnumberOne-based argument position inspected by the filter.
instance_namestringExact Instance.Name value required for a match.

Returns

TypeDescription
InstanceNameFilterA filter that matches when the selected Instance has the stored name.

Description

InstanceNameFilter.new reads the Name property of the Instance at the selected argument position and compares it with the stored string. The argument must be an Instance, and the comparison is case sensitive.

This filter is commonly combined with InstanceTypeFilter to target one specific object in a hook.

Example

local wantsRoot = InstanceNameFilter.new(1, "HumanoidRootPart")
print(wantsRoot) -- InstanceNameFilter

Notes

  • hookfunction accepts a filter as an optional third argument; getfilter accepts one directly.
  • The argument must resolve to an Instance.
  • The comparison is exact and case sensitive.