OnInvoke (Callback)

From Legacy Roblox Wiki
Jump to navigationJump to search
OnInvoke
Parameters: Tuple arguments
Returns: Tuple
Description: Is called when the Invoke method is called. Arguments passed to Invoke are passed to the function. In turn, values returned by the function are returned by the Invoke method.
Member of: BindableFunction


Example
The example below would return an optimistic string.
local func = Instance.new('BindableFunction')

func.OnInvoke = function(name)
	return name .. " is successful!"
end

print(func:Invoke("This")) --> This is successful!