Common mistakes
What HyperScript says when a script does not load, what it means, and how to put it right. The headings are the messages themselves, so the one you got can be searched for.
- Command /hi has no 'trigger:' section
- This line is not inside the trigger
- Unknown command option 'triger'. Did you mean 'trigger'?
- Unexpected indentation (the line above does not end with ':')
- Expected an indented block after ':'
- Unknown event 'player jion'. Did you mean 'player join'?
- Unknown statement 'sned'. Did you mean 'send'?
- Unterminated string (missing closing ")
- Unexpected 'hi'
- Use '==' to compare and 'set ... to ...' to assign
- Expected 'to' but found '5'
- Unknown value %player.nmae%. Variables are written in braces: {player.nmae}
- 'else' without a matching 'if' directly above it
- Unknown block 'gold blok'. Did you mean 'gold block'?
- Expected 'command /name:' or 'on <event>:'
- Nothing happens, and there is no error
Command /hi has no 'trigger:' section
The code of a command was written straight under it. What a command does goes under trigger:, one step further in; the lines directly under the command are its settings.
command /hi:
trigger:
send "hello"
This line is not inside the trigger
A line of code stands after the trigger instead of inside it: it is indented like trigger: itself. Move it one step further in, in line with the other lines of the trigger.
command /hi:
trigger:
send "one"
send "two"
Unknown command option 'triger'. Did you mean 'trigger'?
A setting of a command is misspelt. The message says which one was probably meant. The settings are trigger, permission, description, usage, aliases, cooldown, cooldown message, players only, console only and tab complete.
Unexpected indentation (the line above does not end with ':')
A line is further in than the one above it, but the one above does not open a block. Nearly always a : is missing at the end of that line: after on player join, after an if, after else.
on player join:
if player is op:
send "Hello, operator."
Expected an indented block after ':'
A line ends with : and nothing under it is indented. Whatever belongs to it has to be further in than it is, by four spaces.
on player join:
send "Welcome!"
Unknown event 'player jion'. Did you mean 'player join'?
There is no event of that name. The message offers the nearest one. Every event there is, with what it gives a script, is in the Events reference.
Unknown statement 'sned'. Did you mean 'send'?
The first word of a line is not something HyperScript can do. Usually it is a slip of the fingers, and the message says what was meant.
Unterminated string (missing closing ")
A text was opened with " and never closed on that line.
on player join:
send "Welcome!"
Unexpected 'hi'
The line was understood up to that word, and the word does not fit there. Two things cause it most often:
- A quote inside a text.
send "He said "hi""ends the text at the second quote. Write the inner quotes as\":send "He said \"hi\"". - A name the server does not know, such as
give player 1 dimond. Items, blocks and creatures are written as the game names them:diamond,gold block,zombie.
Use '==' to compare and 'set ... to ...' to assign
A single = was used. Giving a variable a value is set {_x} to 5; asking whether two things are the same is if {_x} == 5: or if {_x} is 5:.
on player join:
set {_x} to 5
if {_x} == 5:
send "five"
Expected 'to' but found '5'
A word the statement needs is missing: here the to of set {_x} to 5. The message names the word that should have stood there and what stood there instead.
Unknown value %player.nmae%. Variables are written in braces: {player.nmae}
Something between two % is not a value HyperScript knows. Either it is misspelt (%player.name%), or it was meant to be a variable of yours, which is written in braces: {coins}, and inside a text %{coins}%. Every built-in value is listed under Built-in placeholders.
'else' without a matching 'if' directly above it
An else: has to follow an if that is indented exactly as far as it is, with nothing but the if's own lines in between.
on player join:
if player is op:
send "Hello, operator."
else:
send "Hello."
Unknown block 'gold blok'. Did you mean 'gold block'?
The server has no block, item or creature of that name. Names are the game's own, with spaces or underscores: gold block, oak planks, diamond sword.
Expected 'command /name:' or 'on <event>:'
A line of code stands at the left edge of the file, outside everything. Code always lives inside something: a command's trigger, an event, a function, a timer.
on load:
log "The script is loaded."
Nothing happens, and there is no error
The script loaded, so every line is something HyperScript understands. Then it is the logic:
- Is the event the right one?
/hs debug <player>shows every line as it runs for that player. - Is a condition false that you took to be true? Send the value to yourself:
send "%{coins}%". - Did the file load at all?
/hs listshows the scripts that are loaded, and/hs errorswhat went wrong lately.