PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

OnInvoke

BindableFunction

Tuple

This callback can be set multiple times, but cannot be called directly. It is called when the BindableFunction/Invoke method is called, using the same arguments as parameters.

There are limitations on the valid parameters this callback can return (see the code samples to learn more).

Parameters

Name Type Default Description

These are the parameters sent when the BindableFunction is Invoked.

Expected return type:

Return Type Summary

Code Samples


BindableFunction Addition

This code sample sets the OnInvoke callback of the parent BindableFunction to a function that returns the sum of two numbers. Test this code sample by pasting this code inside a Script within a BindableFunction. You’ll then be able to use Invoke on the BindableFunction from other scripts.


BindableFunction Valid Values

This code sample shows the kinds of values that can be sent to and from BindableFunctions via Invoke/OnInvoke. Test this code by placing a Script within a BindableFunction inside the Workspace or ServerScriptService. It will raise errors on the values that cannot be sent.