Ir para conteúdo

gabrielbuff

Campones
  • Total de itens

    29
  • Registro em

  • Última visita

Tudo que gabrielbuff postou

  1. Boa noite, alguém poderia me ajudar, preciso de um script em movements em que o player precisa de x quantidade de storage para passar no tile, exemplo, ele precisa completar 5 vezes a quests diárias que dão storage 1234, após ele completar 5x as quests diárias, para ele poder passar no tile.
  2. @jepart, testei e funcionou, só tive que tirar o }, e funcionou perfeitamente
  3. @Poccnn, o que teria de errado no script coragem? local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = msg:lower() local config = { effectonuse = 14, -- efeito que sai levelsorte = 10, --- leveis que terão item = 10563, quant = 1+getPlayerStorageValue(cid,4002), storage = 4002 -- storage que será verificado } if(msgcontains(msg, 'wisdom' )) then npcHandler:say("Voce deseja evoluir seu nível de Wisdom?", cid) elseif msgcontains(msg, {"não","no"}) then selfSay('Ok!', cid) talkState[talkUser] = 0 elseif msgcontains(msg, {"yes","sim"}) then if getPlayerStorageValue(cid, config.storage) < config.levelsorte then if getPlayerItemCount(cid, config.item) >= config.quant then doPlayerRemoveItem(cid, config.item, config.quant) doBroadcastMessage("[MENSAGEM]: O jogador (" .. getCreatureName(cid) .. ") recebeu um nivel de Wisdom da NPC Kelly.", 19) doPlayerSendTextMessage(cid,22,"Voce evoluiu wisdom para "..(getPlayerStorageValue(cid, config.storage)+1)..".") setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1) elseif getPlayerStorageValue(cid, config.storage) >= config.levelsorte then else selfSay('Você de '..config.quant..' {book of player}.', cid) end else selfSay('Você ja esta no level maxímo.' , cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. Boa noite, poderiam me ajudar nesse erro abaixo, quando eu falo hi, para algum npc aparece esse erro, impossibilitando a compra ou venda de itens nele 012-Table.lua -> script table.find = function (table, value) for i, v in pairs(table) do if(v == value) then return i end end return nil end table.contains = function (txt, str) for i, v in pairs(str) do if(txt:find(v) and not txt:find('(%w+)' .. v) and not txt:find(v .. '(%w+)')) then return true end end return false end table.isStrIn = table.contains table.count = function (table, item) local count = 0 for i, n in pairs(table) do if(item == n) then count = count + 1 end end return count end table.countElements = table.count table.getCombinations = function (table, num) local a, number, select, newlist = {}, #table, num, {} for i = 1, select do a[#a + 1] = i end local newthing = {} while(true) do local newrow = {} for i = 1, select do newrow[#newrow + 1] = table[a] end newlist[#newlist + 1] = newrow i = select while(a == (number - select + i)) do i = i - 1 end if(i < 1) then break end a = a + 1 for j = i, select do a[j] = a + j - i end end return newlist end
  5. boa noite Marshmello, continua o mesmo erro amigo
  6. boa noite, estou com uns erros no script do zombie event e não estou conseguindo solucionar o problema, se alguém puder ajudar agradeço!! Segue script e anexo o erro que está ocorrendo. local config = { playerCount = 2001, -- Global storage for counting the players left/entered in the event zombieCount = 2002, -- Global storage for counting the zombies in the event teleportActionId = 2000, -- Action id of the teleport needed for the movement script teleportPosition = {x = 1143, y = 1054, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 1152, y = 1028, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 2, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 5, -- Seconds between each spawn of zombie zombieName = "Zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 5, -- Players needed before the zombies can spawn. walls = {x = 1189, y = 1044, z = 7, stackpos = 1}, -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 1135, y = 1018, z = 7}, {x = 1170, y = 1040, z = 7}, -- top left cornor of the playground toPosition = {x = 1170, y = 1040, z = 7}, {x = 1135, y = 1018, z = 7}, -- bottom right cornor of the playground } function onThink() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: O evento 'Zumbi' começará em 2 minutos. O portal será fechado quando o evento começar.", MESSAGE_STATUS_CONSOLE_BLUE) doRemoveItem(getThingFromPos(config.walls).uid, 1) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) print(getGlobalStorageValue(2001)) end function startEvent() local get = getThingfromPos(config.teleportPosition) if get.itemid == config.teleportId then doRemoveItem(get.uid, 1) doCreateItem(9486, 9532, 1, config.walls) end local fromPosition, toPosition = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: Boa sorte no evento 'Zumbi' jogadores! O portal foi fechado! E o primeiro zumbi aparecerá em 5 segundos.", MESSAGE_STATUS_CONSOLE_BLUE) doCreateItem(9486, 9532, 1, config.walls) for x = fromp.x, top.x do for y = fromp.y, top.y do for z = fromp.z, top.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doBroadcastMessage(getPlayers.uid, "EVENTO ZUMBI MENSAGEM: O primeiro zumbie vai aparecer em " .. config.timeBetweenSpawns .. " segundos. Boa sorte!", MESSAGE_STATUS_CONSOLE_BLUE) end end end end else doBroadcastMessage("EVENTO ZUMBI MENSAGEM: O evento 'Zumbi' não pode ser iniciado pelo pequeno número de jogadores participando. No mínimo " .. config.playersNeededToStartEvent .. " jogadores é necessário!", MESSAGE_STATUS_CONSOLE_BLUE) doCreateItem(9486, 9532, 1, config.walls) for x = fromPosition.x, toPosition.x do for y = fromPosition.y, toPosition.y do for z = fromPosition.z, toPosition.z do areapos = {x = x, y = y, z = z, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doRemoveCreature(pid) doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), true) doSendMagicEffect(getPlayerPosition(getPlayers.uid), CONST_ME_TELEPORT) end end end end end end function spawnZombie() if getGlobalStorageValue(config.playerCount) >= 2 then pos = {x = math.random(config.fromPosition.x, config.toPosition.x), y = math.random(config.fromPosition.y, config.toPosition.y), z = math.random(config.fromPosition.z, config.toPosition.z)} doSummonCreature(config.zombieName, pos) doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("EVENTO ZUMBI MENSAGEM: Um novo zumbi apareceu! Agora temos: " .. getGlobalStorageValue(config.zombieCount) .. " zumbis no evento!", MESSAGE_STATUS_CONSOLE_BLUE) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end primeiro erro: segundo erro:
  7. Boa tarde, teriam como me ajudar? queria que especificasse de qual monstro dropou x item, o item dropa de vários monstros diferentes ex: ele esta assim no momento -> DROP MENSAGEM: O Jogador (Admin) Dropou o Item (golden helmet). queria que especificasse o monstro que dropou o item, ficaria assim ex: DROP MENSAGEM: O Jogador (Admin) Dropou o Item (golden helmet) de Demon . DROP MENSAGEM: O Jogador (Admin) Dropou o Item (golden helmet) de Orshabaal. local config = { [1] = {itemid= 2471}, -- id do item [2] = {itemid= 2470}, -- id do item [3] = {itemid= 2466}, -- id do item } function examine(cid, position, corpse_id) if not isPlayer(cid) then return true end local corpse = getTileItemById(position, corpse_id).uid if corpse <= 1 or not isContainer(corpse) then return true end for slot = 0, getContainerSize(corpse) - 1 do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return true end for i = 1, #config do if item.itemid == config.itemid then doBroadcastMessage("DROP MENSAGEM: O Jogador (" .. getCreatureName(cid) .. ") Dropou o Item (" .. getItemNameById(config.itemid) .. ")." , 19) end end end end function onKill(cid, target) if not isMonster(target) then return true end local corpse_id = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(examine, 2, cid, getThingPos(target), corpse_id) return true end
  8. Queria um script que ao player dropar x item de um aviso no default ex: O jogador Test dropou um golden helmet de x monstro. tenho esse script como base, queria que desse para adicionar mais itens e que identificasse qual item e monstro dropou ex: itemid =2471 golden helmet , x player matou orshabaal Mensagem > O jogador Teste, dropou um golden helmet de orshabaal itemid =7730 blue legs, x player matou warlock Mensagem > O jogador Test Mage, dropou uma blue legs de warlock local config = { itemid = 2471, --ID do item. drop_effect = false --Efeito que aparecerá em cima da corpse, OPCIONAL! Se não quiser, coloque false. } function examine(cid, position, corpse_id) if not isPlayer(cid) then return true end local corpse = getTileItemById(position, corpse_id).uid if corpse <= 1 or not isContainer(corpse) then return true end for slot = 0, getContainerSize(corpse) - 1 do local item = getContainerItem(corpse, slot) if item.uid <= 1 then return true end if item.itemid == config.itemid then doBroadcastMessage("DROP MENSAGEM: O Jogador (" .. getCreatureName(cid) .. ") Dropou Golden Helmet.", 19) if config.drop_effect then doSendMagicEffect(position, config.drop_effect, cid) end end end end function onKill(cid, target) if not isMonster(target) then return true end local corpse_id = getMonsterInfo(getCreatureName(target)).lookCorpse addEvent(examine, 2, cid, getThingPos(target), corpse_id) return true end
  9. Poccnn ele serviu sim, só faltou a contagem regressiva em 5 posições(configuraveis)
  10. mendiguinho91, não funcionou, mais tambem não deu erro, ao usar a alavanca só aparece essa mensagem : " Aguarde até que seja liberada"
  11. Poccnn, isso mesmo que eu queria.. mais faltou o time exemplo: 60, 59, 58..(contagem regressiva) na alavanca e em mais 4posições, configuraveis.
  12. Esse script funciona desta maneira, é uma anihi que precisam de 5 jogadores, ao entrar na quest, os jogadores tem 120 segundos para matarem os bichos, caso não consigam serão levados ao templo, e ao puxar a alavanca fica uma contagem de 120 ao 0... porem ao terminar a contagem ninguem consegue mais entrar, fica bloqueada e não esta teletransportando os player para x posição desejada não ocorre nenhum erro no distro. function isOnSameFloor(fromPos, toPos) return fromPos.z == toPos.z and true or false end function isEven(arg) return arg % 2 == 0 and true or false end function getMiddlePos(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local middle = {x = 0, y = 0, z = 0} middle.x = isEven(fromPos.x + toPos.x) and (fromPos.x + toPos.x)/2 or math.floor((fromPos.x + toPos.x)/2) + 1 middle.y = isEven(fromPos.y + toPos.y) and (fromPos.y + toPos.y)/2 or math.floor((fromPos.y + toPos.y)/2) + 1 middle.z = fromPos.z or toPos.z return middle end function getDistanceRadius(fromPos, toPos) if not isOnSameFloor(fromPos, toPos) then return false end local distance = getDistanceBetween(fromPos, toPos) return isEven(distance) and (distance/2) or math.floor(distance/2) + 1 end function clearArea(middlePos, rangex, rangey) local final = {x=1382, y=837, z=8} -- Posição onde será teleportado quando acabar o tempo for i = -rangex, rangex do for j = -rangey, rangey do pos = {x = middlePos.x + i, y = middlePos.y + j, z = middlePos.z} creature = getTopCreature(pos).uid if isMonster(creature) then doSendMagicEffect(getThingPos(creature), 14) doRemoveCreature(creature) elseif isPlayer(creature) then doSendMagicEffect(getThingPos(creature), 10) doTeleportThing(creature, final) end end end setGlobalStorageValue(sto, -1) return true end local t = { lvl = 100, entrada = { {x = 1427, y = 824, z = 7}, -- pos players {x = 1426, y = 824, z = 7}, -- pos players {x = 1425, y = 824, z = 7}, -- pos players {x = 1424, y = 824, z = 7}, -- pos players {x = 1423, y = 824, z = 7}, -- pos players }, saida = { {x = 1440, y = 824, z = 7}, -- pos para onde eles irão {x = 1439, y = 824, z = 7}, -- pos para onde eles irão {x = 1438, y = 824, z = 7}, -- pos para onde eles irão {x = 1437, y = 824, z = 7}, -- pos para onde eles irão {x = 1436, y = 824, z = 7}, -- pos para onde eles irão }, monstros = { {{x = 1434, y = 822, z = 7}, "Demon"}, -- defina pos dos montros e nomes {{x = 1434, y = 824, z = 7}, "Demon"}, -- defina pos dos montros e nomes {{x = 1434, y = 826, z = 7}, "Demon"}, -- defina pos dos montros e nomes {{x = 1442, y = 822, z = 7}, "Demon"}, -- defina pos dos montros e nomes {{x = 1442, y = 824, z = 7}, "Demon"}, -- defina pos dos montros e nomes {{x = 1442, y = 826, z = 7}, "Demon"}, -- defina pos dos montros e nomes } } function onUse(cid, item, fromPosition, itemEx, toPosition) local configure = { fromPos = {x=1433, y=820, z=7}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=1443, y=828, z=7}, -- posição inferior direita do mapa, da area em que esta mapeado a area. boss = "Demon" -- Aqui você bota o nome do monstro que você quer remover } local config = { position = {x=1428, y=824, z=7}, -- Contagem position1 = {x=1434, y=821, z=7}, -- Contagem position2 = {x=1434, y=827, z=7}, -- Contagem position3 = {x=1442, y=821, z=7}, -- Contagem position4 = {x=1442, y=827, z=7}, -- Contagem fromPosition = {x=1433, y=820, z=7}, toPosition = {x=1443, y=828, z=7}, id = 1498, time = 1 -- tempo que o teleport ira sumir em minutos } local time = 60 local sto = 5973 local check = {} for _, k in ipairs(t.entrada) do local x = getTopCreature(k).uid if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < t.lvl) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você precisa de 5 jogadores para entrar na quest.") return true end if getGlobalStorageValue(sto) == 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde até que seja liberada.") return true end table.insert(check, end for _, summon in pairs(t.monstros) do local creature = getTopCreature(summon[1]).uid doCreateMonster(summon[2], summon[1]) end for i, tid in ipairs(check) do doTeleportThing(tid, t.saida, false) doSendMagicEffect(t.saida, 10) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) end for i = 1,time do formula = time - 1*i addEvent(doSendAnimatedText, i*1000, config.position, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position1, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position2, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position3, formula, TEXTCOLOR_RED) addEvent(doSendAnimatedText, i*1000, config.position4, formula, TEXTCOLOR_RED) end setGlobalStorageValue(sto, 1) local rx = getDistanceRadius(configure.fromPos, configure.toPos) addEvent(clearArea, config.time * 60 * 1000, getMiddlePos(configure.fromPos, configure.toPos), rx, rx) return true end
  13. ela apresenta esse erro acima toda vez que da use na alavanca e quando não tem player suficiente ele não apresenta erro nenhum so a mensagem 'não tem 5 players necessario'. [Error - Action interface] data/actions/scripts/anihi.lua:onUse Description: data/actions/scripts/anihi.lua:183: attempt to index field '?' <anil value> stack traceback: data/actions/scripts/anihi.lua:183: in function <data/actions/scripts/anihi.lua:147>
  14. local config = { storage = 9721, time = 120, --Tempo para fazer a quest, em minutos. interval = 2, --Tempo para poder usar a alavanca novamente, em minutos. timerPos = { {x = 1127, y = 1152, z = 7}, --Posições onde o tempo restante aparecerá. {x = 1129, y = 1150, z = 8}, {x = 1129, y = 1156, z = 8}, {x = 1121, y = 1150, z = 8}, {x = 1121, y = 1156, z = 8}, }, monster = { name = "Demon", --Nome do monstro. pos = { {x = 1434, y = 822, z = 7}, --Posições onde ele vai nascer. {x = 1434, y = 824, z = 7}, {x = 1434, y = 826, z = 7}, {x = 1442, y = 822, z = 7}, {x = 1442, y = 824, z = 7}, {x = 1442, y = 826, z = 7}, }, }, player = { {{x = 1427, y = 824, z = 7}, {x = 1440, y = 824, z = 7}}, --{{posição onde o player deve ficar}, {para onde será teleportado}}, {{x = 1426, y = 824, z = 7}, {x = 1439, y = 824, z = 7}}, {{x = 1425, y = 824, z = 7}, {x = 1438, y = 824, z = 7}}, {{x = 1424, y = 824, z = 7}, {x = 1437, y = 824, z = 7}}, {{x = 1423, y = 824, z = 7}, {x = 1436, y = 824, z = 7}}, }, area = {{x = 1433, y = 820, z = 7}, {x = 1443, y = 828, z = 7}}, --{{posição superior esquerda da área}, {posição inferior direita da área}}, } local cidPos = {} function clearArea() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if pid > 0 then if isPlayer(pid) then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Você não conseguiu completar a Quest.") else doRemoveCreature(pid) end end end end setGlobalStorageValue(config.storage, os.time() + config.interval * 60) end function checkPlayer() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if isPlayer(pid) then return true end end end return false end function convert(time) for i = 1, #config.timerPos do doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) end end function timer(time) if time < 0 or not checkPlayer() then return true end doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) addEvent(timer, 1000, time - 1) end function onUse(cid) if getGlobalStorageValue(config.storage) > os.time() then return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.") elseif checkPlayer() then return doPlayerSendCancel(cid, "Tem Player fazendo a Quest,Aguarde!.") end local p = {} for _, pos in pairs(config.player) do local pid = getTopCreature(pos[1]).uid if isPlayer(pid) then p[#p + 1] = pid cidPos[pid] = _ end end if #p < #config.player then return doPlayerSendCancel(cid, "Não tem 5 Player necessarios.") end for i = 1, #p do doTeleportThing(p, config.player[cidPos[p]][2]) doPlayerSendTextMessage(p, 27, "Boa sorte!") end for _, pos in pairs(config.monster.pos) do doCreateMonster(config.monster.name, pos) end timer(config.time) addEvent(function() clearArea() end, config.time * 60 * 1000) return true end
  15. deadpool, script esta completo peguei ele de um outro site.. esta completo aparentemente porem com esse bug, se você puder terminar ele te agradeceria muito
  16. Alguém poderia me ajudar, essa anihi modificada não está teleportando o player para x posição. na hora de dar use na alavanca ela da como se não tivesse players na posição inicial e apresenta o seguinte erro abaixo. [Error - Action interface] data/actions/scripts/anihi.lua:onUse Description: data/actions/scripts/anihi.lua:183: attempt to index field '?' <anil value> stack traceback: data/actions/scripts/anihi.lua:183: in function <data/actions/scripts/anihi.lua:147> local config = { storage = 9721, time = 120, --Tempo para fazer a quest, em minutos. interval = 2, --Tempo para poder usar a alavanca novamente, em minutos. timerPos = { {x = 1127, y = 1152, z = 7}, --Posições onde o tempo restante aparecerá. {x = 1129, y = 1150, z = 8}, {x = 1129, y = 1156, z = 8}, {x = 1121, y = 1150, z = 8}, {x = 1121, y = 1156, z = 8}, }, monster = { name = "Demon", --Nome do monstro. pos = { {x = 1434, y = 822, z = 7}, --Posições onde ele vai nascer. {x = 1434, y = 824, z = 7}, {x = 1434, y = 826, z = 7}, {x = 1442, y = 822, z = 7}, {x = 1442, y = 824, z = 7}, {x = 1442, y = 826, z = 7}, }, }, player = { {{x = 1427, y = 824, z = 7}, {x = 1440, y = 824, z = 7}}, --{{posição onde o player deve ficar}, {para onde será teleportado}}, {{x = 1426, y = 824, z = 7}, {x = 1439, y = 824, z = 7}}, {{x = 1425, y = 824, z = 7}, {x = 1438, y = 824, z = 7}}, {{x = 1424, y = 824, z = 7}, {x = 1437, y = 824, z = 7}}, {{x = 1423, y = 824, z = 7}, {x = 1436, y = 824, z = 7}}, }, area = {{x = 1433, y = 820, z = 7}, {x = 1433, y = 828, z = 7}}, --{{posição superior esquerda da área}, {posição inferior direita da área}}, } local cidPos = {} function clearArea() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if pid > 0 then if isPlayer(pid) then doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_RED, "Você não conseguiu completar a Quest.") else doRemoveCreature(pid) end end end end setGlobalStorageValue(config.storage, os.time() + config.interval * 60) end function checkPlayer() for x = config.area[1].x, config.area[2].x do for y = config.area[1].y, config.area[2].y do local pos = {x = x, y = y, z = config.area[1].z} local pid = getTopCreature(pos).uid if isPlayer(pid) then return true end end end return false end function convert(time) for i = 1, #config.timerPos do doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) end end function timer(time) if time < 0 or not checkPlayer() then return true end doSendAnimatedText(config.timerPos, convert(time).minutes..":"..convert(time).seconds, 215) addEvent(timer, 1000, time - 1) end function onUse(cid) if getGlobalStorageValue(config.storage) > os.time() then return doPlayerSendCancel(cid, "Wait "..convert(getGlobalStorageValue(config.storage) - os.time()).minutes.."min and "..convert(getGlobalStorageValue(config.storage) - os.time()).seconds.."secs.") elseif checkPlayer() then return doPlayerSendCancel(cid, "Tem Player fazendo a Quest,Aguarde!.") end local p = {} for _, pos in pairs(config.player) do local pid = getTopCreature(pos[1]).uid if isPlayer(pid) then p[#p + 1] = pid cidPos[pid] = _ end end if #p < #config.player then return doPlayerSendCancel(cid, "Não tem 5 Player necessarios.") end for i = 1, #p do doTeleportThing(p, config.player[cidPos[p]][2]) doPlayerSendTextMessage(p, 27, "Boa sorte!") end for _, pos in pairs(config.monster.pos) do doCreateMonster(config.monster.name, pos) end timer(config.time) addEvent(function() clearArea() end, config.time * 60 * 1000) return true end
  17. esta funcionando normal, mais faltou a contagem regressiva em cima do teleporte 30, 29 ,28..
  18. Olá, alguem poderia me ajudar nesse script, ele funciona certinho sem erros tals. mais eu queria que quando o monstro morresse.. nascesse o teleporte com a contagem regressiva em cima dele( 30, 29, 28...), ficarei muito grato se alguem me ajudasse. creaturescript.. local tpId = 1387 local tps = { ["Zugurosh"] = {pos = {x=1478, y=879, z=7}, toPos = {x=1491, y=874, z=7}, time = 30}, } function removeTp(tp) local t = getTileItemById(tp.pos, tpId) if t then doRemoveItem(t.uid, 1) doSendMagicEffect(tp.pos, CONST_ME_POFF) end end function onDeath(cid) local tp = tps[getCreatureName(cid)] if tp then doCreateTeleport(tpId, tp.toPos, tp.pos) doBroadcastMessage("O Zugurosh foi morto. O teleporte irá desaparecer em "..tp.time.." segundos.", 19) addEvent(removeTp, tp.time*1000, tp) end return TRUE end
  19. Alguém me ajuda nesse erro? ele está funcionando mais fica dando esse seguinte erro no distro.. É um script de uma alavanca ao ser puxada ela cria um teleporte com uma contagem regressiva em cima dele por exemplo: 30, 29, 28... [Error - Action Interface ] data/actions/scripts/evento.lua:onUse Description: data/actions/scripts/evento.lua:28: attempt to index local 'item' <a number value> Stack traceback: data/actions/scripts/evento.lua:28: in function <data/action/scripts/evento.lua:19> local toPos = {x = 1375, y = 835, z = 7} --pos para onde o player sera teleportado local createPos = {x = 1378, y = 837, z = 7} --pos aonde o tp sera criado local tpID = 1387 --id do tp, nunca usei um, n sei se eh esse ms... local tempo = 120 --90seg local function removeTP(pos, id, time) if time == 0 then local item = getTileItemById(pos, id).uid if item > 1 then doRemoveItem(item, 1) doSendAnimatedText(pos, "Closed!", 227) end else doSendAnimatedText(pos, time, 192) addEvent(removeTP, 1000, pos, id, time-1) end end function onUse(cid, item, frompos, item2, topos) local item = getTileItemById(createPos, tpID).uid if item then return doPlayerSendTextMessage(cid, 27, "The teleport already is open!") end doCreateTeleport(tpID, toPos, createPos) removeTP(createPos, tpID, tempo) doPlayerSendTextMessage(cid, 27, "O teleporte foi aberto, ele fechará em 30 segundos!") doTransformItem(item.uid, (item.itemid == 1945 and 1946 or 1945)) return true end
  20. Alguem poderia me ajudar nesse comando de !ranks.. queria que o gm, god etc, não aparecesse no rank. talkactions script.. local ranks = { ['fist'] = {0}, ['club'] = {1}, ['sword'] = {2}, ['axe'] = {3}, ['distance'] = {4}, ['shield'] = {5}, ['fish'] = {6}, ['magic'] = {7}, ['level'] = {8}, } function onSay(cid, words, param) local msg = string.lower(param) if ranks[msg] ~= nil then str = getHighscoreString((ranks[msg][1])) else str = getHighscoreString((8)) end doShowTextDialog(cid,6500, str) return TRUE end
  21. Alguem me ajuda nesse script de lookfrags? o que tem de errado nele, quando você fraga, o death tambem sobe.. function getDeaths(cid) local query, d = db.getResult("SELECT `player_id` FROM `player_killers` WHERE `player_id` = " ..getPlayerGUID(cid)), 0 if (query:getID() ~= -1) then repeat d = d+1 until not query:next() query:free() end return d end function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then return doPlayerSetSpecialDescription(thing.uid, '\n'.. '[Frags: ' .. getPlayerFrags(thing.uid) .. ' - Deaths: ' .. getDeaths(thing.uid) .. ']') elseif thing.uid == cid then local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end string = string..'\n'.. '[Frags: ' .. getPlayerFrags(cid) .. ' - Deaths: ' .. getDeaths(cid) .. ']' if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) end return 1 end
  22. Kawoszin, não deu certo apareceu seguinte erro. [22/02/2016 11:25:32] [Error - LuaScriptInterface::loadFile] data/actions/scripts/liquids/ultimate_health.lua:14: 'then' expected near ')' [22/02/2016 11:25:32] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/liquids/ultimate_health.lua) [22/02/2016 11:25:32] data/actions/scripts/liquids/ultimate_health.lua:14: 'then' expected near ')' conseguir arrumar não tinha nada a ver com as potion, era so ir na libs e adicionar a vocation. mais valeu pela ajuda.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...