getsignal Synchronous
Read one event from the same sorted list returned by getsignals. This is handy when you are browsing an Instance’s events by index in a small inspection tool.
Luau
getsignal(instance: Instance, index: number) -> RBXScriptSignal?Parameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Instance whose events will be enumerated. |
index | number | Positive, one-based integer in the getsignals result. |
Returns
RBXScriptSignal?An RBXScriptSignal at the requested position, or nil when that position is beyond the list.
Usage notes
The list is rebuilt on each call. 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
part:Destroy()