Postado Outubro 29, 2017 7 anos Tá errado aí topLeftPos = {x = 1736, y = 1855, z = 8}, É a posição do canto superior esquerdo da sala, perto do pilar lá bottomRightPos = {x = 1736, y = 1855, z = 8} É a posição do canto inferior direito da sala, perto do ultimo pilar. E usa esse aqui, configura ali o monstro e tals Spoiler local config = { money = 1000, daily = "no", level = 5, storage = 30015, areas = { [1] = { topLeftPos = {x = 1736, y = 1855, z = 8}, bottomRightPos = {x = 1736, y = 1855, z = 8}, }, [2] = { topLeftPos = {x = 1736, y = 1855, z = 8}, bottomRightPos = {x = 1736, y = 1855, z = 8}, }, }, entry = { {x = 1085, y = 1145, z = 6}, }, destination = { {x = 1082, y = 11144, z = 6}, } } local posmonstro = {x = 1083. y = 11144, z = 6} local monstro = "Nome" config.daily = getBooleanFromString(config.daily) local function CheckAnihilationInUse() for i = 1, #config.areas do for x = config.areas.topLeftPos.x, config.areas.bottomRightPos.x do for y = config.areas.topLeftPos.y, config.areas.bottomRightPos.y do for z = config.areas.topLeftPos.z, config.areas.bottomRightPos.z do local creature = getTopCreature({x = x, y = y, z = z}).uid if isPlayer(creature) then return true end end end end end return false end local function RemoveMonsters() local monsters = {} for i = 1, #config.areas do for x = config.areas.topLeftPos.x, config.areas.bottomRightPos.x do for y = config.areas.topLeftPos.y, config.areas.bottomRightPos.y do for z = config.areas.topLeftPos.z, config.areas.bottomRightPos.z do local position = {x = x, y = y, z = z, stackpos = 253} local creature = getThingfromPos(position) if isMonster(creature.uid) then table.insert(monsters, creature.uid) end end end end end for m in pairs(monsters) do doRemoveCreature(m) end end function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 6265) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 6265) then return true end if CheckAnihilationInUse() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "A arena esta em uso, espere.") 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 or getPlayerMoney(cid) < config.money) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "No minimo players de level ".. config.level .." e possuir ".. config.money .." gold coins.") return true end table.insert(players, pid) end RemoveMonsters() doCreateMonster(monstro, posmonstro) doSendMagicEffect(config.entry, CONST_ME_POFF) doTeleportThing(cid, config.destination, false) doSendMagicEffect(config.destination, CONST_ME_ENERGYAREA) doTransformItem(item.uid, item.itemid + 1) return true end Editado Outubro 29, 2017 7 anos por psychonaut (veja o histórico de edições) Life is so meaningless, there is nothing worth a smile So goodbye, I'll miss you sugestões?
Postado Outubro 29, 2017 7 anos Autor @psychonaut Deu errado , a porta ficou de lado dnv, e não aconteceu nada. ItemID: [2091]. < ID Da Key Editado Outubro 29, 2017 7 anos por OfWar Esqueci de por key (veja o histórico de edições)
Postado Outubro 29, 2017 7 anos Como tá no xml, e o id 6265 é a porta ou a chave? Life is so meaningless, there is nothing worth a smile So goodbye, I'll miss you sugestões?
Postado Outubro 29, 2017 7 anos Spoiler local config = { money = 1000, daily = "no", level = 5, storage = 30015, areas = { [1] = { topLeftPos = {x = 1736, y = 1855, z = 8}, bottomRightPos = {x = 1736, y = 1855, z = 8}, }, [2] = { topLeftPos = {x = 1736, y = 1855, z = 8}, bottomRightPos = {x = 1736, y = 1855, z = 8}, }, }, entry = { {x = 1085, y = 1145, z = 6}, }, destination = { {x = 1082, y = 11144, z = 6}, } } local posmonstro = {x = 1083. y = 11144, z = 6} local monstro = "Nome" config.daily = getBooleanFromString(config.daily) local function CheckAnihilationInUse() for i = 1, #config.areas do for x = config.areas.topLeftPos.x, config.areas.bottomRightPos.x do for y = config.areas.topLeftPos.y, config.areas.bottomRightPos.y do for z = config.areas.topLeftPos.z, config.areas.bottomRightPos.z do local creature = getTopCreature({x = x, y = y, z = z}).uid if isPlayer(creature) then return true end end end end end return false end local function RemoveMonsters() local monsters = {} for i = 1, #config.areas do for x = config.areas.topLeftPos.x, config.areas.bottomRightPos.x do for y = config.areas.topLeftPos.y, config.areas.bottomRightPos.y do for z = config.areas.topLeftPos.z, config.areas.bottomRightPos.z do local position = {x = x, y = y, z = z, stackpos = 253} local creature = getThingfromPos(position) if isMonster(creature.uid) then table.insert(monsters, creature.uid) end end end end end for m in pairs(monsters) do doRemoveCreature(m) end end function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 6265) then if(config.daily) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true else doTransformItem(item.uid, item.itemid - 1) end end if(item.itemid ~= 6265) then return true end if CheckAnihilationInUse() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "A arena esta em uso, espere.") 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 or getPlayerMoney(cid) < config.money) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "No minimo players de level ".. config.level .." e possuir ".. config.money .." gold coins.") return true end table.insert(players, pid) end RemoveMonsters() doCreateMonster(monstro, posmonstro) doSendMagicEffect(config.entry, CONST_ME_POFF) doTeleportThing(cid, config.destination, false) doSendMagicEffect(config.destination, CONST_ME_ENERGYAREA) doTransformItem(item.uid, item.itemid + 1) return true end soh mudei uma linha de lugar Life is so meaningless, there is nothing worth a smile So goodbye, I'll miss you sugestões?
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.