I have this error:
With this script:
Its a save script from 0.4 but I'm moving to 1.0 and the default script is a globalsave(afaik)
Code:
Lua Script Error: [Test Interface]
data/globalevents/scripts/save.lua
data/globalevents/scripts/save.lua:8: attempt to call global 'getBooleanFromStri
ng' (a nil value)
stack traceback:
[C]: in function 'getBooleanFromString'
data/globalevents/scripts/save.lua:8: in main chunk
[Warning - Event::checkScript] Can not load script: scripts/save.lua
data/globalevents/scripts/effectile.lua:22: '}' expected (to close '{' at line 1
) near 'effects'
With this script:
Code:
local config = {
broadcast = {120, 30, 5},
shallow = "no",
delay = 120,
events = 30
}
config.shallow = getBooleanFromString(config.shallow)
local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
local text = ""
if(not config.shallow) then
text = "Full s"
else
text = "S"
end
text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
doBroadcastMessage(text)
end
if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.shallow)
end
end
function onThink(interval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.shallow)
else
executeSave(config.delay)
end
return true
end
Its a save script from 0.4 but I'm moving to 1.0 and the default script is a globalsave(afaik)