Ir para conteúdo

zipter98

Membro
  • Registro em

  • Última visita

Tudo que zipter98 postou

  1. Hm, ok. Pode postar seu order.lua, de data/lib?
  2. Claro, basta remover esta linha: doPlayerSendTextMessage(killer, MESSAGE_STATUS_CONSOLE_ORANGE, left.." "..getCreatureName(cid)..(left > 1 and "s" or "").." left to kill.")
  3. Na verdade, os parênteses devem permanecer. E sim, basta configurar o(s) dia(s) na tabela e o evento será executado perfeitamente.
  4. Para o evento ser executado em outros dias, basta usar o seguinte código: local days = {"Saturday", "Sunday", "Monday"} --Mude os dias que o evento será executado nesta tabela. EM INGLÊS. local id = 1547 local posis = { {x = 71, y = 620, z = 6}, -- posição da barreira {x = 72, y = 620, z = 6}, -- posição da barreira {x = 73, y = 620, z = 6}, -- posição da barreira {x = 74, y = 620, z = 6}, -- posição da barreira {x = 75, y = 620, z = 6}, -- posição da barreira {x = 71, y = 618, z = 6}, -- posição da barreira {x = 72, y = 618, z = 6}, -- posição da barreira {x = 73, y = 618, z = 6}, -- posição da barreira {x = 74, y = 618, z = 6}, -- posição da barreira {x = 75, y = 618, z = 6}, -- posição da barreira } function onTime() if isInArray(days, os.date("%A")) then for i = 1, #posis do local item = getTileItemById(posis[i], id).uid if item > 0 then doRemoveItem(item, 1) else doCreateItem(id, 1, posis[i]) end end end return true end
  5. Na verdade, eu refiz o código e o simplifiquei. Porém, a funcionalidade é a mesma. Quando digo erros no console, quero dizer erros que aparecem no executável (aquele responsável por ligar o servidor). Geralmente, quando um script dá erro, são relatados erros neste executável. E obrigado. PS: Teste esta versão do script (talvez o erro esteja no callback): local day = "Saturday" --Mude o dia que o evento será executado aqui. EM INGLÊS. local id = 1547 local posis = { {x = 71, y = 620, z = 6}, -- posição da barreira {x = 72, y = 620, z = 6}, -- posição da barreira {x = 73, y = 620, z = 6}, -- posição da barreira {x = 74, y = 620, z = 6}, -- posição da barreira {x = 75, y = 620, z = 6}, -- posição da barreira {x = 71, y = 618, z = 6}, -- posição da barreira {x = 72, y = 618, z = 6}, -- posição da barreira {x = 73, y = 618, z = 6}, -- posição da barreira {x = 74, y = 618, z = 6}, -- posição da barreira {x = 75, y = 618, z = 6}, -- posição da barreira } function onTime() if os.date("%A") == day then for i = 1, #posis do local item = getTileItemById(posis[i], id).uid if item > 0 then doRemoveItem(item, 1) else doCreateItem(id, 1, posis[i]) end end end return true end
  6. Estranho, testei aqui meu código e funcionou perfeitamente. Você configurou corretamente o horário na tag? E tem certeza que não houve nenhum erro no console?
  7. ..., você copiou errado. Muda: ocal monsters = { para: local monsters = {
  8. Simplesmente não funcionou? Algum erro na distro? PS: Você configurou o dia certo, né? Hoje é sexta, então para testar você deve configurar o valor da variável day para Friday.
  9. Tag: <!-- Mude 17:00 para o horário que quer que o Castle Event seja aberto. --> <globalevent name="openCastle" time="17:00" event="script" value="arquivo.lua"/> Não se esqueça de mudar arquivo.lua para o nome do arquivo que será colocado o código abaixo. local day = "Saturday" --Mude o dia que o evento será executado aqui. EM INGLÊS. local id = 1547 local posis = { {x = 71, y = 620, z = 6}, -- posição da barreira {x = 72, y = 620, z = 6}, -- posição da barreira {x = 73, y = 620, z = 6}, -- posição da barreira {x = 74, y = 620, z = 6}, -- posição da barreira {x = 75, y = 620, z = 6}, -- posição da barreira {x = 71, y = 618, z = 6}, -- posição da barreira {x = 72, y = 618, z = 6}, -- posição da barreira {x = 73, y = 618, z = 6}, -- posição da barreira {x = 74, y = 618, z = 6}, -- posição da barreira {x = 75, y = 618, z = 6}, -- posição da barreira } function onTimer(cid, interval, lastExecution) if os.date("%A") == day then for i = 1, #posis do local item = getTileItemById(posis[i], id).uid if item > 0 then doRemoveItem(item, 1) else doCreateItem(id, 1, posis[i]) end end end return true end Se não funcionar, mude: function onTimer(cid, interval, lastExecution) para: function onTime()
  10. Abaixo de: if isInArray(skills["fly"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["fly"][math.random(1, #txt["fly"])].."", 1) addEvent(goThere, 500, mysum, topos, "fly", isCreature(getCreatureTarget(cid))) elseif isInArray(skills["levitate_fly"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["levitate_fly"][math.random(1, #txt["levitate_fly"])].."", 1) --alterado v2.8 addEvent(goThere, 500, mysum, topos, "fly", isCreature(getCreatureTarget(cid))) else doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["ride"][math.random(1, #txt["ride"])].."", 1) addEvent(goThere, 500, mysum, topos, "ride", isCreature(getCreatureTarget(cid))) end coloque: addEvent(function() if #getCreatureSummons(cid) > 0 then for i = 1, #getCreatureSummons(cid) do doRemoveCreature(getCreatureSummons(cid)[i]) end end end, 500)
  11. Manda seu order.lua, de data/actions/scripts.
  12. Sem problemas. Use esta tag: <event type="login" name="mountLogin" event="script" value="xxx.lua"/> Em xxx.lua, você coloca o nome do arquivo.lua.
  13. Troque seu código por esse: -- [( Mount System 1.4 created by Matheus for TibiaKing.com )] -- function onUse(cid, item) local outfit = 342 -- Outfit da montaria! local exhaust = 30 -- Tempo para player poder usar o item novamente! (tempo em segundos) local time = 60 -- Tempo para ficar na montaria! (tempo em segundos) local speed = 500 -- Velocidade adicionada ao player após usar o item! (300 = velocidade, quanto maior mais rapido...) local mana = 0 -- Quantidade de mana que o player necessita para usar o sistema! local premium = true -- Apenas players premium accounts true (sim) ou false (não)!? local storage, storage_time = 9393, 9394 --Não mexa aqui! if premium and not isPremium(cid) then return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.") elseif getCreatureMana(cid) < mana then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA) elseif getPlayerStorageValue(cid, storage) > os.time() then return doPlayerSendCancel(cid, "Sorry, you only can again use this item after "..exhaust.." seconds.") else doCreatureSay(cid, "Yeeeah!!!\nYou went up on his ride.", 19) doSetCreatureOutfit(cid, {lookType = outfit}, -1) doChangeSpeed(cid, speed) doSendMagicEffect(getCreaturePosition(cid), 34) setPlayerStorageValue(cid, storage, os.time() + exhaust) setPlayerStorageValue(cid, storage_time, os.time() + time) doPlayerAddMana(cid, -mana) addEvent(function() if isPlayer(cid) then doChangeSpeed(cid, -speed) doPlayerSendTextMessage(cid, 23, "Mount System is time out!") doSendMagicEffect(getCreaturePosition(cid), 2) doRemoveCondition(cid, CONDITION_OUTFIT) end end, time * 1000) end return true end Em data/creaturescripts/scripts, crie um arquivo com extensão .lua e adicione o seguinte conteúdo: local cfg = { storage = 9394, speed = 500, --Velocidade adicionada ao player após usar o item! (300 = velocidade, quanto maior mais rapido...) outfit = 342, --Outfit da montaria! } function onLogin(cid) if getPlayerStorageValue(cid, cfg.storage) > os.time() then doSetCreatureOutfit(cid, {lookType = cfg.outfit}, -1) doChangeSpeed(cid, cfg.speed) end return true end Sabe fazer a tag? PS: Não precisa registrar nada em login.lua.
  14. Para não remover 1 unidade do item ao usá-lo, basta retirar esta linha: doRemoveItem(item.uid, 1)
  15. Desculpe, pensei que você sabia configurar. data/creaturescripts/scripts, crie um arquivo com extensão .lua, nomeie-o avisar, e coloque o código que passei em meu comentário anterior. Depois, em data/creaturescripts, abra o arquivo creaturescripts.xml e coloque a seguinte tag, abaixo de semelhantes (porém antes de </creaturescripts>): <event type="death" name="avisarServer" event="script" value="avisar.lua"/> Depois, em data/monster, abra o arquivo XML do monstro e coloque, antes do </monster>, isso: <script> <event name="avisarServer"/> </script>
  16. data/creaturescripts/scripts: local monster = "monster_name" --Nome do monstro. function onDeath(cid, corpse, deathList) if isMonster(cid) and getCreatureName(cid) == monster and isPlayer(deathList[2] or deathList[1]) then broadcastMessage("O Jogador "..getCreatureName(deathList[2] or deathList[1]).." matou a criatura campeã "..monster..".") end return true end Não se esqueça de registrar o evento no arquivo XML do monstro.
  17. Hm, estranho. Salva o arquivo pelo bloco de notas com codificação UTF-8 e veja se o erro continua.
  18. Erros no console?
  19. 1º pedido: 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 price = xxx --Preço para trocar de sexo. if msgcontains(msg:lower(), "change") or msgcontains(msg:lower(), "sex") then selfSay("Do you wanna change your sex? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if doPlayerRemoveMoney(cid, price) then doPlayerSetSex(cid, getPlayerSex(cid) == 0 and 1 or 0) selfSay("You sucefully changed your sex.", cid) talkState[talkUser] = 0 return true else selfSay("You do not have enough gold.", cid) talkState[talkUser] = 0 return true end elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2º pedido: 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 price = xxx --Preço para trocar o nome. local characters = {} --Configure nesta tabela os caracteres (ou palavras) proibidos. local delay = 5 --Tempo para o jogador ser desconectado após trocar o nome. if msgcontains(msg:lower(), "name") or msgcontains(msg:lower(), "change") then selfSay("Do you wanna change your name? It will cost {"..price.." gold}.", cid) talkState[talkUser] = 1 return true elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then if getPlayerMoney(cid) >= price then selfSay("OK, tell me your new name.", cid) talkState[talkUser] = 2 return true else selfSay("You do not have enough money.", cid) talkState[talkUser] = 0 return true end elseif talkState[talkUser] == 2 then local query = db.getResult("SELECT name FROM players") if query:getID() == -1 then selfSay("Database inexistent.", cid) talkState[talkUser] = 0 return true end repeat local name = query:getDataString("name") if msg == name then selfSay("This name is already in use.", cid) talkState[talkUser] = 0 return true end until not query:next() query:free() for i = 1, #characters do if msg:find(characters[i]) then selfSay("Sorry, this name isn't available.", cid) talkState[talkUser] = 0 return true end end db.executeQuery("UPDATE players SET name = '"..msg.."' WHERE id = "..getPlayerGUID(cid)) doPlayerRemoveMoney(cid, price) selfSay("You changed your name to {"..msg.."}. In "..delay.." second"..(delay > 1 and "s" or "")..", you will be disconected.", cid) addEvent(function() if isPlayer(cid) then doRemoveCreature(cid) end end, delay * 1000) talkState[talkUser] = 0 return true elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then selfSay("Ok, bye.", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  20. Não é exatamente uma correção, mas sim uma proteção. Na linha 635, troque: doCreatureAddHealth(cid, -valor, 3,combats[damageCombat].cor) por: if damageCombat and combats[damageCombat] then doCreatureAddHealth(cid, -valor, 3, combats[damageCombat].cor) end
  21. Qualquer coisa, talkaction: local teleport = { tpId = 1328, --ID do teleporte. tpPos = {x = x, y = y, z = z}, --Onde o teleporte será criado. tpToPos = {x = x, y = y, z = z}, --Para onde ele levará. } function onSay(cid, words) local tp = doCreateTeleport(teleport.tpId, teleport.tpToPos, teleport.tpPos) doPlayerSendTextMessage(cid, 27, "You created the teleport.") doItemSetAttribute(tp, "aid", 3434) return true end Movement: local tpId = 1328 --ID do teleporte. function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end addEvent(function() if getTileItemById(position, tpId).uid > 0 then doRemoveItem(getTileItemById(position, tpId).uid, 1) end end, 5) return true end Mesmas tags que o Caronte passou.
  22. Copiaram? Me poupe, né. Seu código nem funcional é, lol.
  23. Ops, esqueci de um número. Código corrigido.
  24. zipter98 postou uma resposta no tópico em Design Show Off
    ficou legal. ( ͡° ͜ʖ ͡°)

Informação Importante

Confirmação de Termo