> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getcallbackvalue

Reads the function bound to a callback property on a `BindableFunction` or `RemoteFunction`.

```luau theme={null}
getcallbackvalue(object: Instance, property: string): function?
```

Usually, you can only **assign** a callback like `OnInvoke`, but reading it back throws an error. <br /> `getcallbackvalue` gets the function you assigned.

## Parameters

| Parameter  | Type       | Description                                |
| ---------- | ---------- | ------------------------------------------ |
| `object`   | `Instance` | The Instance owning the callback property. |
| `property` | `string`   | The callback property name.                |

## Returns

`function?` - the function assigned to the callback, or `nil` if none was assigned.

## Aliases

* `getcallbackmember`

## Example

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  local val = getcallbackvalue(game:GetService("Players").LocalPlayer, "OnTeleport")
  =======
  -- getcallbackvalue(object: Instance, property: string): function?
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local bf = Instance.new("BindableFunction")
  bf.OnInvoke = function()
      return "result"
  end

  local callback = getcallbackvalue(bf, "OnInvoke")
  print(callback()) --> result

  local rf = Instance.new("RemoteFunction")
  print(getcallbackvalue(rf, "OnClientInvoke")) --> nil
  ```
</CodeGroup>

<Tip>
  Useful for intercepting or replacing BindableFunction callbacks.
</Tip>
