Appearance
Trigger Function
Defines a reusable function that can be called from anywhere using Call Function.
Inputs: None · Outputs: Then
INFO
This node is used to define a function. To call it, use the Call Function node.
Description
The Function node acts as an entry point for reusable logic. Define a function once, then call it from multiple places in the same flow (or from other flows) using the Call Function node.
Settings
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
| Enabled | Boolean | No | true | Enable or disable this function. |
| Function Name | String | Yes | — | A unique name for this function (e.g., myFunction). Must match the name used in Call Function nodes. |
| Description | String | No | — | A description of what this function does. No effect on functionality. |
How It Works
- Create a Function node and give it a name (e.g.,
healPlayer). - Connect the Then output to whatever actions the function should perform.
- Elsewhere in your flow, use a Call Function node with the same name to trigger this function's logic.
Example
Define a function called announceJoin:
- Set Function Name to
announceJoin - Connect Then → Send Message (
%player% has joined!to All Players) - From your Event Trigger (Player Joins), add a Call Function with name
announceJoin
Tips
- Functions can accept arguments passed by the Call Function node, accessible via
%arg_1%,%arg_2%, etc. - Use functions to avoid duplicating the same sequence of nodes in multiple places.
- Functions only run synchronously for the moment. When calling the function, the code waits for the function to complete before continuing.
