HyperScript
Docs

← All of the Docs Working with values

Records and tables (custom data)

Guide and examples

HyperScript has no user-defined types. Structured data is built from variable names instead, in two ways that combine freely.

Records: group related values under one prefix.

set {%player%.home.x} to player.x
set {%player%.home.y} to player.y
set {%player%.home.z} to player.z

Tables: put a run-time value inside the name with %...%, giving one variable per key.

set {balance.%player.name%} to 250
set {_target} to arg.1
send "%{_target}% has %{balance.%{_target}%}% coins"

The inserted part is lower-cased like the rest of the name, so Steve and steve are the same key. Combined with lists (below), this covers most data a script needs to keep.