getcallbackmember Synchronous
getcallbackvalue
Read an assigned callback member on an Instance as a callable. It is useful when a callback property is not exposed through ordinary property reading.
Luau
getcallbackmember(instance: Instance, member: string) -> Function?Parameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Instance with a reflected callback member. |
member | string | Case-sensitive callback member name. |
Returns
Function?The assigned callback function, or nil when the member has no callback.
Usage notes
The member must be a callback in the class reflection metadata; a regular event or property is different.
Example
Luau
local bindable = Instance.new("BindableFunction")
bindable.OnInvoke = function(value) return value end
local callback = getcallbackmember(bindable, "OnInvoke")
print(type(callback)) -- function
bindable:Destroy()