Skip to content

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 scopeWhen you want
LocalA temporary value for the current flow only.
PlayerA value stored separately for each player.
GlobalOne shared value for the server network.

Scope Comparison

PropertyLocalPlayerGlobal
Stored forCurrent flow runOne playerEveryone
Shared between playersNoNoYes
Can persistNoYesYes
Best forTemporary checks, loop values, calculationsCoins, quest state, toggles, player statsEvents, 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:

  1. Set Variable: temp_damage, Scope: Local, Value: 0
  2. Add to it during a loop with Math Variable
  3. 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:

  1. Set Boolean: vip_flight, Scope: Player, Persistent: enabled
  2. 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:

  1. Set Boolean: double_xp_event, Scope: Global, Persistent: enabled
  2. Reward flows check double_xp_event
  3. Rewards change for everyone while it is true

Persistent Values

Some Player and Global variables can be persistent.

PersistentMeaning
EnabledThe value survives restarts and reconnects.
DisabledThe 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:

ScopePrefixExample
Localtemp.%temp.loop_index%
Playernone%coins%
Globalglobal.%global.double_xp_event%

Without a prefix, variables are checked in this order:

  1. Local
  2. Player
  3. 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.

Oasis Admin Editor Documentation