Postado Setembro 10, 2017 7 anos Quando estão posicionados nos devidos sqm e usa alavanca, só não funciona, por nada nessa vida! local config = { daily = "no", -- allow only one enter per day? (like in global Tibia) level = 1000, storage = 30015, entry = { {x = 1375, y = 1256, z = 7}, {x = 1376, y = 1256, z = 7}, {x = 1377, y = 1256, z = 7}, {x = 1378, y = 1256, z = 7} }, destination = { {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6} } } config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1946) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 1945) 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
Postado Setembro 10, 2017 7 anos Solução @JcA, execute com essas modificações, faça as ações necessárias para entrar na annihi e veja o que irá printar no console. Mostrar conteúdo oculto local config = { daily = "no", -- allow only one enter per day? (like in global Tibia) level = 1000, storage = 30015, entry = { {x = 1375, y = 1256, z = 7}, {x = 1376, y = 1256, z = 7}, {x = 1377, y = 1256, z = 7}, {x = 1378, y = 1256, z = 7} }, destination = { {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6}, {x = 1919, y = 1375, z = 6} } } config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1946) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 1945) then print("Annihilator: Wrong ID.") 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) print("Annihilator: Error 01.") 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 ➥ Regras | Seções OTServ | Seções BOT
Postado Setembro 10, 2017 7 anos @JcA, não printou nada no console? ➥ Regras | Seções OTServ | Seções BOT
Postado Setembro 10, 2017 7 anos Autor Em 10/09/2017 em 22:14, Wakon disse: @JcA, não printou nada no console? print("Annihilator: Error 01.")
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.