• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Console Error

azav3

New Member
Joined
Apr 14, 2012
Messages
12
Reaction score
0
Error on console:
Code:
[Error - LuaInterface::loadFile] data/globalevents/scripts/save.lua:13: unfinished string near '")'

save.lua
Code:
local config = {
	broadcast = "yes"
}

config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
	if(seconds == 0) then
		doSaveServer()
		return true
	end

	if(seconds == 120 or seconds == 30) then
		doBroadcastMessage("Server will be save in " .. seconds .. ")
	end

	seconds = seconds - 30
	if(seconds >= 0) then
		addEvent(executeSave, 30 * 1000, seconds)
	end
end

function onThink(interval, lastExecution, thinkInterval)
	if(not config.broadcast) then
		doSaveServer()
		return true
	end

	executeSave(120)
	return true
end

Any idea?
 
LUA:
local config = {
	broadcast = "yes"
}

config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
	if(seconds == 0) then
		doSaveServer()
		return true
	end

	if(seconds == 120 or seconds == 30) then
		doBroadcastMessage("Server will be save in " .. secounds .. ")
	end

	seconds = seconds - 30
	if(seconds >= 0) then
		addEvent(executeSave, 30 * 1000, seconds)
	end
end

function onThink(interval, lastExecution, thinkInterval)
	if(not config.broadcast) then
		doSaveServer()
		return true
	end

	executeSave(120)
 return true
end
 
@up
you phail

LUA:
local config = {
	broadcast = "yes"
}
 
config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
	if(seconds == 0) then
		doSaveServer()
		return true
	end
 
	if(seconds == 120 or seconds == 30) then
		doBroadcastMessage("Server will be save in " .. secounds .. ".")
	end
 
	seconds = seconds - 30
	if(seconds >= 0) then
		addEvent(executeSave, 30 * 1000, seconds)
	end
end
 
function onThink(interval, lastExecution, thinkInterval)
	if(not config.broadcast) then
		doSaveServer()
		return true
	end
 
	executeSave(120)
 return true
end
 
Thanks WarOfTheTitans!
It seems y forgot to close the (")

Now, could u help me with other console error?

Error on Console:
LUA:
[Error - LuaInterface::loadFile] data/creaturescripts/scripts/login.lua:14: '=' expected near '=='

Login.lua
LUA:
storage = 9876
seconds = 3
-- Config --
function onLogin(cid)
    gone = os.time()
    if getGlobalStorageValue(storage)+seconds < gone then
        setGlobalStorageValue(storage, os.time())
        return TRUE
    else
        return FALSE
    end
return TRUE
end

local config = {
    [0] = { msg="+Fist", efex=38},
    [1] = { msg="+Mace", efex=26},
    [2] = { msg="+Swrd", efex=24},
    [3] = { msg="+Axe", efex=25},
    [4] = { msg="+Dist", efex=2},
    [5] = { msg="+Def", efex=11},
    [6] = { msg="+Fish", efex=12},
    [7] = { msg="+ML", efex=35},
    [8] = { msg="+LvL", efex=37} }
 
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL then
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
    end
 
local p = getPlayerPosition(cid)
local positions = {
        [1] = { pos= {x=p.x+1,y=p.y,z=p.z}, delay = 100, delay2 = 900},
        [2] = { pos= {x=p.x+1,y=p.y+1,z=p.z}, delay = 200, delay2 = 980},
        [3] = { pos= {x=p.x,y=p.y+1,z=p.z}, delay = 300, delay2 = 1060},
        [4] = { pos= {x=p.x-1,y=p.y+1,z=p.z}, delay = 400, delay2 = 1140},
        [5] = { pos= {x=p.x-1,y=p.y,z=p.z}, delay = 500, delay2 = 1220},
        [6] = { pos= {x=p.x-1,y=p.y-1,z=p.z}, delay = 600, delay2 = 1300},
        [7] = { pos= {x=p.x,y=p.y-1,z=p.z}, delay = 700, delay2 = 1380},
        [8] = { pos= {x=p.x+1,y=p.y-1,z=p.z}, delay = 800, delay2 = 1460} }
 
    for i = 1, 8 do
        addEvent(doSendDistanceShoot, positions[i].delay, positions[i].pos, p, config[skill].efex)
        addEvent(doSendDistanceShoot, positions[i].delay2, positions[i].pos, p, config[skill].efex)
    end
       addEvent(doSendMagicEffect, 900, p, 49)
    doSendAnimatedText(p, config[skill].msg.."["..newlevel.."]", math.random(255))
    doPlayerSave(cid, true)    
return true
end
 
Back
Top