Lua:
local config = {
daily = "no",
level = 120,
storage = 30015
entry =
{
{x = 32362, y = 32155, z = 7},
{x = 32362, y = 32156, z = 7},
{x = 32362, y = 32157, z = 7},
{x = 32362, y = 32158, z = 7}
},
destination =
{
{x = 32354, y = 32125, z = 6},
{x = 32354, y = 32126, z = 6},
{x = 32354, y = 32127, z = 6},
{x = 32354, y = 32128, z = 6}
}
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 5055) then
if(config.daily) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
if(item.itemid ~= 5056) then
return true
end
local players = {}
for _, position in ipairs(config.entry) do
local pid = getTopCreature(position).uid
if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
table.insert(players, pid)
end
for i, pid in ipairs(players) do
doSendMagicEffect(config.entry[i], CONST_ME_POFF)
doTeleportThing(pid, config.destination[i], false)
doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
return true
end
Error
Lua:
[05/07/2010 11:19:23] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'
[05/07/2010 11:19:23] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[05/07/2010 11:19:23] data/actions/scripts/quests/annihilator.lua:5: '}' expected (to close '{' at line 1) near 'entry'