setcallbackvalue
Writes an instance callback.
Syntax
setcallbackvalue(instance: Instance, property: string, fn: function) -> nil
Parameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to read from or modify. |
property | string | The property name to access. |
fn | function | The function or callback to use. |
Returns
| Type | Description |
|---|---|
nil | This function does not return a value. |
Description
setcallbackvalue is part of the Reflection library. Reflection walks Roblox's property metadata to read or write values that are normally hidden from scripts.
The change is applied directly to the live target, so later reads observe the updated value.
The aliases setcallbackmember, set_callback_value, set_callback_member resolve to the same implementation.
Example
setcallbackvalue(workspace, "ChildAdded", function(child)
print(child)
end)
Notes
- Aliases:
setcallbackmember,set_callback_value,set_callback_member. - Reflection reads live property metadata; hidden-property writes can desynchronise client state.