Page 1 of 1

LuaCommandProcessing

Posted: Fri May 12, 2017 10:33 pm
by Hermios
Hi
Can someone explain me how it works?
In my control.lua, I set up :
commands.add_command("clearDb","input db to clear",
function(db)
if not db or db=="trains" then
global.trains={}
end
if not db or db=="trainstations" then
global.trainStations={}
end
end
)

Then, I call it in the lua console :
/c commands.clearDb()
But it says that the key "clearDb" doesn't exist... why!!!???

THanks

Hermios

Re: LuaCommandProcessing

Posted: Fri May 12, 2017 11:29 pm
by Rseding91
You don't do /c commands.clearDb

You just do

/clearDb