Appearance
Variable Scopes
Variable scope controls where a variable is stored and who can read it.
You choose a scope when using nodes such as Set Variable, Set Boolean, Check Variable, Check Boolean, and Math Variable.
Quick Choice
| Choose this scope | When you want |
|---|---|
| Local | A temporary value for the current flow only. |
| Player | A value stored separately for each player. |
| Global | One shared value for the server network. |
Scope Comparison
| Property | Local | Player | Global |
|---|---|---|---|
| Stored for | Current flow run | One player | Everyone |
| Shared between players | No | No | Yes |
| Can persist | No | Yes | Yes |
| Best for | Temporary checks, loop values, calculations | Coins, quest state, toggles, player stats | Events, counters, server-wide flags |
Local Scope
Local variables exist only while the current flow is running.
Use Local for:
- Temporary math results
- Loop index or current item values
- Short-lived checks
- Values that should disappear after the branch ends
Example:
- Set Variable:
temp_damage, Scope:Local, Value:0 - Add to it during a loop with Math Variable
- Send the final value in a message
After the flow ends, temp_damage is gone.
Player Scope
Player variables are stored separately for each player.
Use Player for:
- Currency
- Quest progress
- Player toggles
- Cooldown-related state
- Per-player stats
Example:
- Set Boolean:
vip_flight, Scope:Player, Persistent: enabled - Later, Check Boolean:
vip_flight, Scope:Player
Each player has their own vip_flight value.
Global Scope
Global variables are shared by the server network.
Use Global for:
- Server-wide events
- Maintenance flags
- Shared counters
- Network multipliers
- Global announcements state
Example:
- Set Boolean:
double_xp_event, Scope:Global, Persistent: enabled - Reward flows check
double_xp_event - Rewards change for everyone while it is true
Persistent Values
Some Player and Global variables can be persistent.
| Persistent | Meaning |
|---|---|
| Enabled | The value survives restarts and reconnects. |
| Disabled | The value is temporary and may reset when the player disconnects or the server restarts. |
Local variables are never persistent.
Placeholder Prefixes
Use prefixes when you want to read a specific scope:
| Scope | Prefix | Example |
|---|---|---|
| Local | temp. | %temp.loop_index% |
| Player | none | %coins% |
| Global | global. | %global.double_xp_event% |
Without a prefix, variables are checked in this order:
- Local
- Player
- Global
Writing to Another Player
In Set Variable or Set Boolean, you can write a player variable for another player by adding the target in parentheses:
text
coins(Notch)
coins(%command.arg[1]%)Use this for admin tools, reward commands, moderation flows, and player-to-player actions.
Naming Tips
- Use clear names:
quest.stage,reward.claimed,event.points. - Use Local for temporary values instead of creating unnecessary Player variables.
- Use Global only when every player or server should share the same value.
- Avoid reusing the same name across scopes unless you intentionally use prefixes.
