BuildcordDocs

Switch

Take a different path for each value.

logic.switch compares one value with a list of cases and leaves by the one it equals: one node instead of a chain of comparisons.

Settings

SettingWhat it does
ValueWhat to look at, such as {option.tier}.
CasesOne per line. Each gets its own way out.

Ways out

  • One per case, labelled with the case.
  • Anything else, when the value equals none of them.

Notes

  • Text ignores capitals and spaces at either end; numbers compare as numbers, so 5 matches 5.0.
  • The first case that matches wins.
  • In the blueprint each case leads out by case: and the case in lowercase, with dashes for anything else: "Gold tier" is case:gold-tier.

Example

A /role command with a text option colour and cases red, green and blue, each wired to its own Add role.

On this page