InstanceNameFilter.new
InstanceNameFilter.new creates a filter that checks an Instance name.
Syntax
InstanceNameFilter.new(argument_index: number, instance_name: string) -> InstanceNameFilter
Parameters
| Parameter | Type | Description |
|---|---|---|
argument_index | number | One-based argument position inspected by the filter. |
instance_name | string | Exact Instance.Name value required for a match. |
Returns
| Type | Description |
|---|---|
InstanceNameFilter | A 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.