Postado Outubro 8, 2017 7 anos Boa noite tk, Bom vou ser breve, alguém poderia adicionar 3 coisas nesse script para mim ?. 1- Remover monstros( exemplo: Puxei a lavanca e morri lá dentro, aí quando outra pessoa for, o monstro que me matou lá some e nasce outro com a vida full. 2- Mensagens ( exemplo: Quando estiver faltando players, ou quando o player não tiver level suficiente, dinheiro e tals ... essas mensagens. 3- Apenas um time entrar por vez na quest, aí só pode entrar quando o time que estiver fazendo sair ou morrer é claro kk...( que no caso também mande uma mensagem pra quem puxar a alavanca, falando que tem outro time fazendo a quest... desde já agradeço REP+ Pra quem me ajudar. local config = { money = 1000, --Preço cobrado para cada jogador. daily = "no", -- allow only one enter per day? (like in global Tibia) level = 5, storage = 30015, entry = { {x = 1736, y = 1855, z = 8}, }, destination = { {x = 1737, y = 1868, z = 8}, }, TOWERPosition = { {x = 1737, y = 1869, z = 8}, } } 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 j = 1, 1 do doSummonCreature("Destroyer TOWER", config.TOWERPosition[j]) 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 Outubro 9, 2017 7 anos Solução 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 = 1736, y = 1855, z = 8}, }, destination = { {x = 1737, y = 1868, z = 8}, }, TOWERPosition = { {x = 1737, y = 1869, z = 8}, } } config.daily = getBooleanFromString(config.daily) local function CheckAnihilationInUse() for i = 1, #config.areas do for x = config.areas[i].topLeftPos.x, config.areas[i].bottomRightPos.x do for y = config.areas[i].topLeftPos.y, config.areas[i].bottomRightPos.y do for z = config.areas[i].topLeftPos.z, config.areas[i].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[i].topLeftPos.x, config.areas[i].bottomRightPos.x do for y = config.areas[i].topLeftPos.y, config.areas[i].bottomRightPos.y do for z = config.areas[i].topLeftPos.z, config.areas[i].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 i = 1, #monsters do doRemoveCreature(monsters[i]) end end 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 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() for i = 1, #config.TOWERPosition do doSummonCreature("Destroyer TOWER", config.TOWERPosition[i]) 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 Editado Outubro 9, 2017 7 anos por Danyel Varejao (veja o histórico de edições)
Postado Outubro 9, 2017 7 anos Autor Opa meu amigo, só não entendi essa parte, poderia me explicar ? topLeftPos = {x = 1736, y = 1855, z = 8}, -- Topo de cima < /\ bottomRightPos = {x = 1736, y = 1855, z = 8}, -- Area de baixo V \/ 16 minutos atrás, Danyel Varejao disse: local config = { money = 1000, daily = "no", level = 5, storage = 30015, area = { topLeftPos = {x = 1736, y = 1855, z = 8}, -- Topo de cima < /\ bottomRightPos = {x = 1736, y = 1855, z = 8}, -- Area de baixo V \/ }, entry = { {x = 1736, y = 1855, z = 8}, }, destination = { {x = 1737, y = 1868, z = 8}, }, TOWERPosition = { {x = 1737, y = 1869, z = 8}, } } config.daily = getBooleanFromString(config.daily) local function checkAnihilationToUse() for x = config.area.topLeftPos.x, config.area.bottomRightPos.x do for y = config.area.topLeftPos.y, config.area.bottomRightPos.y do for z = config.area.topLeftPos.z, config.area.bottomRightPos.z do local position = {x = x, y = y, z = z, stackpos=253} local thing = getThingfromPos(position) if not isPlayer(thing.uid) then return true end end end end return false end local function RemoveMonsters() local monsters = {} for x = config.area.topLeftPos.x, config.area.bottomRightPos.x do for y = config.area.topLeftPos.y, config.area.bottomRightPos.y do for z = config.area.topLeftPos.z, config.area.bottomRightPos.z do local Creature = getTopCreature({x = x, y = y, z = z}) if Creature.type == 1 then return elseif Creature.type == 2 then table.insert(monsters, Creature.uid) end end end end for i = 1, #monsters do doRemoveCreature(monsters[i]) end end 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 if not checkAnihilationToUse() then doPlayerSendDefaultCancel(cid, MESSAGE_EVENT_ORANGE, "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) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end table.insert(players, pid) end RemoveMonsters() for i = 1, #config.TOWERPosition do doSummonCreature("Destroyer TOWER", config.TOWERPosition[i]) 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 amigo, acabei de testar aqui, não está mandando a mensagem, e não está removendo as tower e também está dando pra entrar varias pessoas ao mesmo tempo..... Editado Outubro 9, 2017 7 anos por ZeenG (veja o histórico de edições)
Postado Outubro 9, 2017 7 anos Autor 6 minutos atrás, Danyel Varejao disse: Se você não configurou a area certa não vai remover.. Então no caso vai ser, onde começa e onde termina as torres ? e se for dois andares ? posso só adicionar mais duas linhas de left e battom ? pronto agora está removendo, mas não está mandando as mensagem, e ainda pode entrar dois times de uma vez... Editado Outubro 9, 2017 7 anos por ZeenG (veja o histórico de ediçõ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.