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.

Syntax
Luau
getcallbackmember(instance: Instance, member: string) -> Function?

Parameters

Function parameters
ParameterTypeDescription
instanceInstanceInstance with a reflected callback member.
memberstringCase-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

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()
Kawaii documentation