Here is the coding
function admin() if msg:sub(1,6) == "admin " and isAdmin(spkr) then vic = msg:sub(1,9) if findPlayer(vic) then table.Insert(vic, #admins) end
All of the built-in Lua functions are lowercase. It's table.insert
, not table.Insert
.
The parameters to table.insert
are (whichTable, whereInTable, whatThingToPutIn)
(and the whereInTable
is optional -- it defaults to the end of the table).
To add vic
to the table admins
, we would do
table.insert(admins, vic)
EDIT: I screwed up the order of whereInTable
and whatThingToPutIn
, thank you Perci1 for reminding me. (whereInTable
is optional and so this mistake doesn't affect the actual code snippet here)