Skip to content

dictionary<K, V>

Collection

String-keyed (or typed-key) map. map<K,V> is the same emit. Access keys with ..

dictionary<K, V> name = {
{"Key", value},
{"Other", value2}
};
NameTypeDescription
KtypeKey type (usually string).
VtypeValue type.

A map table.

{ [K]: V }

Initializer entries are {"Key", value} pairs, emitted as Key = value when the key is a string.

Read/write: stats.Coinsstats.Coins. Instance properties use the same ..

dictionary<string, int> stats = {
{"Coins", 100},
{"Gems", 50}
};
post(stats.Coins);

Emits:

local stats: { [string]: number } = { Coins = 100, Gems = 50 }
print(stats.Coins)

array · operator-table