I recently bought MaterialBoard from ScriptFodder. I am editing the groups list so it will show the capitalized & un-hyphened group names so instead of head-admin it would look like "Head Admin". Everything has worked so far but once it started using hyphens in the variable name, it concluded errors:
[ERROR] addons/materialboard/lua/matboard_config.lua:76: '}' expected (to close '{' at line 73) near '='
1. unknown - addons/materialboard/lua/matboard_config.lua:0
how do I make it so I can include hyphens in a table variable name like this?
co-owner = "Co-Owner",
local t = {co-owner = "Co-Owner"}
is not valid because -
cannot be used in an identifier. Instead, use the more general syntax:
local t = {["co-owner"] = "Co-Owner"}
print(t["co-owner"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With