HyperScript
Docs

← All of the Docs The basics

Options

Guide and examples

Settings that a script uses in several places can be named once, at the top of the file, and used anywhere in it as {@name}:

options:
    prefix: "&8[&6Shop&8] "
    price: 50
    wait: 10 minutes

command /buy:
    cooldown: {@wait}
    trigger:
        if {%player%.coins} < {@price}:
            send "{@prefix}&cThat costs {@price} coins."
            stop
        subtract {@price} from {%player%.coins}
        give 1 diamond to player
        send "{@prefix}&aBought a diamond."
  • The options: block stands at the left margin, like a command. Each line in it is name: value.
  • An option is not a variable. Before a line is read, every {@name} in it is replaced by the option's value exactly as written, so an option can be a number, a duration, text, an item, a permission, or part of a header such as every {@interval}:.
  • Inside quotes, an option that is itself quoted text is put in without its quotes, which is why "{@prefix}&aBought" works.
  • Options belong to the file they are in and cannot be changed while the server runs. For something that changes, use a variable.
  • Using a name that is not in the block is an error when the script loads.

Saying which version a script needs. A comment # Requires: 1.5.7 among the notes at the top of a file makes an older plugin refuse the file with one clear message, "This script needs HyperScript 1.5.7 or newer", instead of an error about whichever line it does not understand. The scripts on the website's Scripts page all carry one.