I need to use continue in a loop in LUA
I tried this:
but recive this error:
what should i do?
I tried this:
Code:
dofile(getDataDir() .. "actions/scripts/quests.lua")
function onSay(cid, words, param, channel)
local mins = 60
local hours = 60 * 60
local days = 24 * 60 * 60
print("----------")
print(mins, hours, days)
local time = os.time()
local final = ''
-- We are looping from 8000 to 8005, so those are the storages that we will check.
for q, quest in pairs(zexus_quest_list) do
print(q)
local storage = quest -- In this local we get the information, for example if q is equal to 8000 and you print storage.name you will get "Sabre Rook".
local str = ''
-- don't show everything, only exausted one, cause there are a lot of quests
if getPlayerStorageValue(cid, q) < 0 then
-- str = 'You have never done '..storage.name..' quest! Time to get to it.'
goto continue
elseif time - getPlayerStorageValue(cid, q) >= 0 then
-- str = 'You can now do '..storage.name..' quest again!'
goto continue
if getPlayerStorageValue(cid, q) - time > days then
str = 'You must wait '.. math.ceil(((getPlayerStorageValue(cid, q)) - time) / days) ..' days to do the '..storage.name..' quest again.'
elseif getPlayerStorageValue(cid, q) - time > hours then
str = 'You must wait '.. math.ceil(((getPlayerStorageValue(cid, q)) - time) / hours) ..' hours to do the '..storage.name..' quest again.'
else
str = 'You must wait '.. math.ceil(((getPlayerStorageValue(cid, q)) - time) / mins) ..' minutes to do the '..storage.name..' quest again.'
end
final = final .. "[" .. storage.name .. "]: " .. str .. "\n\n"
::continue::
end
doShowTextDialog(cid, 2175, final)
return true
end
but recive this error:
Code:
[14:19:31.152] [Error - LuaInterface::loadFile] data/talkactions/scripts/quests.lua:22: '=' expected near 'continue'
[14:19:31.152] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/quests.lua)
[14:19:31.152] data/talkactions/scripts/quests.lua:22: '=' expected near 'continue'
what should i do?