natiny.script.table_get
Lua
natiny.script.table_get(script, table, key) -> value
Reads a field of a table by name.
Parameters
| Name |
Type |
Description |
script |
number |
The script the table lives in |
table |
reference |
The table to read, from make_table |
key |
string |
Field name |
Returns
| Type |
Description |
any |
What is there, or nil |
Example
Lua
local config = natiny.script.make_table(mod)
natiny.script.set(mod, "config", config)
natiny.script.call(mod, "load_settings") -- the mod fills config in
print(natiny.script.table_get(mod, config, "title"),
natiny.script.table_get(mod, config, "vsync"))