getcallbackvalue
Returns the current value of a callback property on an Instance.
function getcallbackvalue(instance: Instance, property: string): function?Synopsis
How it works
Callback properties like
BindableFunction.OnInvoke and RemoteFunction.OnClientInvoke are write-only in standard Luau — you can assign them but cannot read them back. The executor reads the internal property descriptorProperty descriptorMetadata defining a Roblox Instance property: its type, default value, replication behavior, and access flags (read-only, hidden/non-scriptable, deprecated). Stored in the reflection system. directly from the InstanceInstanceThe base class for all Roblox objects (Parts, Models, Scripts, GUIs, etc.). Instances form a tree hierarchy (the DataModel). In Luau, they appear as userdata with shared metatables.'s C++ memory layout, bypassing the write-only restriction.Use case
Useful for discovering what function a game has registered as a callback handler, allowing you to inspect, clone, or replace it. Common pattern: read the callback, wrap it, and re-assign a modified version.
Usage
Read BindableFunction callback
local bf = workspace.SomeBindableFunction
print(getcallbackvalue(bf, "OnInvoke"))Parameters
instance Instance The instance to read from.
property string The callback property name (e.g., "OnInvoke").
Returns
function? The currently assigned callback function, or nil.