getsignal Synchronous
Read a reflected event from an Instance by its one-based index or signal name.
Luau
getsignal(instance: Instance, indexOrName: number | string) -> RBXScriptSignal?Parameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Instance whose events will be enumerated. |
indexOrName | number | string | Positive, one-based index in the getsignals result, or an exact signal name. |
Returns
RBXScriptSignal?The matching RBXScriptSignal, or nil when the index is beyond the list or the name is not found.
Usage notes
The list is rebuilt on each call. A name shared by multiple signals returns the first match. An invalid index raises an error. Use getsignals when you need to inspect several events at once.
Example
Luau
local part = Instance.new("Part")
local events = getsignals(part)
if #events > 0 then
print(getsignal(part, 1))
end
print(getsignal(part, "Touched"))
part:Destroy()