Skip to content
Saiko

getcallbackvalue

Reads a callback property such as OnInvoke or OnServerInvoke, which normally cannot be read back.

Signature

luau
getcallbackvalue(instance: Instance, property: string): ((...any) -> ...any)?

Parameters

instanceInstance

The instance holding the callback.

propertystring

The callback property name.

Returns

function?

Example

luau
local bindable = Instance.new("BindableFunction")
bindable.OnInvoke = function()
    return "called"
end

local callback = getcallbackvalue(bindable, "OnInvoke")
print(callback()) --> called