Get 1Click Maker

Conditions and Variables โ€‹

Most HUDs are a list of "click โ†’ do this". Variables and conditions add a second layer: the item can remember something and decide what to do based on it.

  • A variable is a labeled box that holds a value: a number, a text, a position, a key.
  • A condition compares two values and runs one function if the comparison is true, another if it is false.

Together they let a single button toggle between ON and OFF, a HUD switch modes, an outfit react to whether the avatar is flying, or a button behave differently for the owner and for other people.

A condition choosing between two helper functions.
A condition choosing between two helper functions.

Requirements โ€‹

  • [add-on] - Conditions & Variables - 1Click inside the object that runs the logic (usually the HUD).
  • Currently included in FREE.

The pieces โ€‹

System Variables Read-only values the system provides: who clicked, which face, the avatar's state and position.

User Variables Values you define and change, prefixed with $.

Creating a Variable Type, name, initial value.

Change Variable The action that sets, adds to or subtracts from a variable.

Conditions Operators, types, success and failure paths.

Creating a Condition The action form, nesting and performance.

Example: an ON/OFF button โ€‹

One button, one variable, one condition:

text
Variable  $light = OFF

Button "switch"
โ””โ”€ Condition: $light == OFF
   โ”œโ”€ success โ†’ Change Variable $light = ON,  Point of Light ON
   โ””โ”€ failure โ†’ Change Variable $light = OFF, Point of Light OFF

The full walkthrough is in the ON/OFF Toggle Button guide.

Current limits โ€‹

  • Variables are compared in conditions and changed with Change Variable. They cannot yet be inserted into other actions' fields (for example, a message that prints a variable's value).
  • Conditions cost more processing than other actions. A few per click are fine; dozens in one flow will feel slow.