Postado Janeiro 4, 2013 12 anos Alguém pode me ajudar nesse script? [0:28:59.231] [Error - GlobalEvent Interface] [0:28:59.231] In a timer event called from: [0:28:59.231] domodlib('lms_config') [0:28:59.231] function endEvent() [0:28:59.231] local playerTable = {} [0:28:59.232] for x = room.fromPos.x, room.toPos.x do [0:28:59.232] for y = room.fromPos.y, room.toPos.y do [0:28:59.232] local n, i = getTileInfo({x=x, y=y, z=7}).creatures, 1 [0:28:59.232] if n ~= 0 then [0:28:59.232] local v = getThingfromPos({x=x, y=y, z=7, stackpos=i}).uid [0:28:59.232] while v ~= 0 do [0:28:59.232] if isPlayer(v) then [0:28:59.232] table.insert(playerTable, v) [0:28:59.232] if n == #playerTable then [0:28:59.232] break [0:28:59.232] end [0:28:59.232] end [0:28:59.232] i = i + 1 [0:28:59.232] v = getThingfromPos({x=x, y=y, z=7, stackpos=i}).uid [0:28:59.232] end [0:28:59.232] end [0:28:59.232] end [0:28:59.232] end [0:28:59.232] if #playerTable == 1 then [0:28:59.232] if isPlayer(playerTable[1]) then [0:28:59.232] doTeleportThing(playerTable[1], config.kickPos, true) [0:28:59.232] doRemoveConditions(playerTable[1]) [0:28:59.232] local item, countMoney = config.rewardID[math.random(#config.rewardID)], math.random(config.money[2]) [0:28:59.232] doPlayerAddItem(playerTable[1], item, 1) [0:28:59.232] doPlayerAddItem(playerTable[1], config.money[1], math.random(config.money[2])) [0:28:59.232] doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) [0:28:59.232] doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! Your reward is '.. getItemNameById(item) ..' and '.. countMoney ..' of '.. getItemNameById(config.money[1]) ..'\'s.') [0:28:59.232] doBroadcastMessage('Last Man Standing Event have finished. The winner is '.. getCreatureName(playerTable[1]) ..'. Congratulations!', MESSAGE_EVENT_ADVANCE) [0:28:59.232] doCreatureSetStorage(playerTable[1], config.storage, -1) [0:28:59.233] end [0:28:59.233] elseif #playerTable >= 1 then [0:28:59.233] doBroadcastMessage('No winner in Last Man Standing Event.', MESSAGE_EVENT_ADVANCE) [0:28:59.233] end [0:28:59.233] [0:28:59.233] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.233] if getCreatureStorage(cid, config.storage) >= 2 then [0:28:59.233] doRemoveConditions(cid) [0:28:59.233] doTeleportThing(cid, config.kickPos, true) [0:28:59.233] doCreatureSetStorage(cid, config.storage, -1) [0:28:59.233] end [0:28:59.233] end [0:28:59.233] doSetStorage(config.joinEventStorage, -1) [0:28:59.233] end [0:28:59.233] [0:28:59.233] function sendBroadcast() [0:28:59.233] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.233] if isPlayer(cid) then [0:28:59.233] if getCreatureStorage(cid, config.storage) >= 2 then [0:28:59.233] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'The event will ends in '.. config.eventTime / 60 / 1000 ..' min.') [0:28:59.233] end [0:28:59.233] end [0:28:59.233] end [0:28:59.233] end [0:28:59.233] function doStartEvent() [0:28:59.233] doSetStorage(config.joinEventStorage, 2) [0:28:59.233] addEvent(endEvent, config.eventTime) [0:28:59.233] addEvent(sendBroadcast, config.eventTime - config.broadcastTimeBeforeEnd) [0:28:59.233] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.233] if getCreatureStorage(cid, config.storage) == 2 then [0:28:59.233] doTeleportThing(cid, config.teleportPos) [0:28:59.233] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Last Man Standing began, only one will win.') [0:28:59.233] end [0:28:59.233] end [0:28:59.233] end [0:28:59.233] function stopJoining() [0:28:59.233] doSetStorage(config.joinEventStorage, -1) [0:28:59.233] addEvent(doStartEvent, config.timeToBuySupplies) [0:28:59.233] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.233] if getCreatureStorage(cid, config.storage) == 1 then [0:28:59.233] doCreatureSetStorage(cid, config.storage, 2) [0:28:59.233] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'The event will begin in '.. config.timeToBuySupplies / 60 / 1000 ..' min. Buy some supplies and be prepared.') [0:28:59.233] end [0:28:59.233] end [0:28:59.233] end [0:28:59.234] function onThink(interval, lastExecution) [0:28:59.234] doBroadcastMessage('Last Man Standing Event will begin in '.. config.joinTime / 60 / 1000 ..' min. You can join to event by saying !event join.', MESSAGE_EVENT_ADVANCE) [0:28:59.234] for _, pid in ipairs(getPlayersOnline()) do [0:28:59.234] if getCreatureStorage(pid, config.storage) >= 2 then [0:28:59.234] doCreatureSetStorage(pid, config.storage, -1) [0:28:59.234] doSetStorage(config.countPlayerStorage, 0) [0:28:59.234] doRemoveConditions(pid) [0:28:59.234] end [0:28:59.234] end [0:28:59.234] doSetStorage(config.joinEventStorage, 1) [0:28:59.234] addEvent(stopJoining, config.joinTime) [0:28:59.234] return true [0:28:59.234] end [0:28:59.234] :onThink [0:28:59.234] Description: [0:28:59.234] (luaGetTileInfo) Tile not found [0:28:59.234] [Error - GlobalEvent Interface] [0:28:59.234] In a timer event called from: [0:28:59.234] domodlib('lms_config') [0:28:59.234] function endEvent() [0:28:59.234] local playerTable = {} [0:28:59.234] for x = room.fromPos.x, room.toPos.x do [0:28:59.234] for y = room.fromPos.y, room.toPos.y do [0:28:59.234] local n, i = getTileInfo({x=x, y=y, z=7}).creatures, 1 [0:28:59.234] if n ~= 0 then [0:28:59.234] local v = getThingfromPos({x=x, y=y, z=7, stackpos=i}).uid [0:28:59.234] while v ~= 0 do [0:28:59.234] if isPlayer(v) then [0:28:59.234] table.insert(playerTable, v) [0:28:59.234] if n == #playerTable then [0:28:59.234] break [0:28:59.234] end [0:28:59.234] end [0:28:59.234] i = i + 1 [0:28:59.234] v = getThingfromPos({x=x, y=y, z=7, stackpos=i}).uid [0:28:59.234] end [0:28:59.234] end [0:28:59.234] end [0:28:59.234] end [0:28:59.234] if #playerTable == 1 then [0:28:59.234] if isPlayer(playerTable[1]) then [0:28:59.234] doTeleportThing(playerTable[1], config.kickPos, true) [0:28:59.234] doRemoveConditions(playerTable[1]) [0:28:59.234] local item, countMoney = config.rewardID[math.random(#config.rewardID)], math.random(config.money[2]) [0:28:59.234] doPlayerAddItem(playerTable[1], item, 1) [0:28:59.234] doPlayerAddItem(playerTable[1], config.money[1], math.random(config.money[2])) [0:28:59.234] doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) [0:28:59.234] doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! Your reward is '.. getItemNameById(item) ..' and '.. countMoney ..' of '.. getItemNameById(config.money[1]) ..'\'s.') [0:28:59.235] doBroadcastMessage('Last Man Standing Event have finished. The winner is '.. getCreatureName(playerTable[1]) ..'. Congratulations!', MESSAGE_EVENT_ADVANCE) [0:28:59.235] doCreatureSetStorage(playerTable[1], config.storage, -1) [0:28:59.235] end [0:28:59.235] elseif #playerTable >= 1 then [0:28:59.235] doBroadcastMessage('No winner in Last Man Standing Event.', MESSAGE_EVENT_ADVANCE) [0:28:59.235] end [0:28:59.235] [0:28:59.235] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.235] if getCreatureStorage(cid, config.storage) >= 2 then [0:28:59.235] doRemoveConditions(cid) [0:28:59.235] doTeleportThing(cid, config.kickPos, true) [0:28:59.235] doCreatureSetStorage(cid, config.storage, -1) [0:28:59.235] end [0:28:59.235] end [0:28:59.235] doSetStorage(config.joinEventStorage, -1) [0:28:59.235] end [0:28:59.235] [0:28:59.235] function sendBroadcast() [0:28:59.235] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.235] if isPlayer(cid) then [0:28:59.235] if getCreatureStorage(cid, config.storage) >= 2 then [0:28:59.235] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'The event will ends in '.. config.eventTime / 60 / 1000 ..' min.') [0:28:59.235] end [0:28:59.235] end [0:28:59.235] end [0:28:59.235] end [0:28:59.235] function doStartEvent() [0:28:59.235] doSetStorage(config.joinEventStorage, 2) [0:28:59.235] addEvent(endEvent, config.eventTime) [0:28:59.235] addEvent(sendBroadcast, config.eventTime - config.broadcastTimeBeforeEnd) [0:28:59.235] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.235] if getCreatureStorage(cid, config.storage) == 2 then [0:28:59.235] doTeleportThing(cid, config.teleportPos) [0:28:59.235] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Last Man Standing began, only one will win.') [0:28:59.708] end [0:28:59.708] end [0:28:59.708] end [0:28:59.708] function stopJoining() [0:28:59.708] doSetStorage(config.joinEventStorage, -1) [0:28:59.708] addEvent(doStartEvent, config.timeToBuySupplies) [0:28:59.708] for _, cid in ipairs(getPlayersOnline()) do [0:28:59.708] if getCreatureStorage(cid, config.storage) == 1 then [0:28:59.708] doCreatureSetStorage(cid, config.storage, 2) [0:28:59.708] doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'The event will begin in '.. config.timeToBuySupplies / 60 / 1000 ..' min. Buy some supplies and be prepared.') [0:28:59.708] end [0:28:59.708] end [0:28:59.708] end [0:28:59.708] function onThink(interval, lastExecution) [0:28:59.708] doBroadcastMessage('Last Man Standing Event will begin in '.. config.joinTime / 60 / 1000 ..' min. You can join to event by saying !event join.', MESSAGE_EVENT_ADVANCE) [0:28:59.708] for _, pid in ipairs(getPlayersOnline()) do [0:28:59.708] if getCreatureStorage(pid, config.storage) >= 2 then [0:28:59.708] doCreatureSetStorage(pid, config.storage, -1) [0:28:59.708] doSetStorage(config.countPlayerStorage, 0) [0:28:59.708] doRemoveConditions(pid) [0:28:59.708] end [0:28:59.708] end [0:28:59.708] doSetStorage(config.joinEventStorage, 1) [0:28:59.708] addEvent(stopJoining, config.joinTime) [0:28:59.708] return true [0:28:59.708] end [0:28:59.708] :onThink [0:28:59.708] Description: [0:28:59.708] [string "LuaInterface::loadBuffer"]:8: attempt to index a boolean value [0:28:59.708] stack traceback: [0:28:59.708] [string "LuaInterface::loadBuffer"]:8: in function <[string "LuaInterface::loadBuffer"]:3>
Postado Janeiro 4, 2013 12 anos arthurluna negativado por double post, você tem tempo de fórum suficiente para saber que isso é contra as regras... 16/11/2014 23/11/2014 RIP AnneMotta 21/01/2012 - 15/01/2014 Liga das lendas: DIAMOND É A META
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.