Postado Março 6, 2019 6 anos boa tarde galerinha do tk estou com um evento no meu otserv que esta dando ums erros chatos na distro vcs podem me ajudar a resolver? quando o evento vai iniciar da esse erro [Error - GlobalEvents::timer] Couldn't execute event: CampoMinado depois vai pra esses [Error - GlobalEvent Interface] In a timer event called from: data/globalevents/scripts/CampoMinado.lua:onTime Description: (luaGetThingFromPosition) Tile not found [Error - GlobalEvent Interface] In a timer event called from: data/globalevents/scripts/CampoMinado.lua:onTime Description: (luaGetThingFromPosition) Tile not found script globalevents function reloadCampoMinado() for x = 478,489 do for y = 621,632 do ppos = {x=x,y=y,z=7,stackpos=2} pos = getThingfromPos(ppos) if pos.itemid == 1502 then doTransformItem(pos.uid,10570) end end end end function onTime() local time = os.date("*t") if (CampoMinado_STARTAUTO) and (isInArray(CampoMinado_DAYS,time.wday)) then doCreateTeleport(1387, _Lib_CampoMinado_Info.DestinoPos, _Lib_CampoMinado_Info.tpPos) doBroadcastMessage("{Campo Minado} Teleport criado no templo, o evento inicia em "..OpenTime.." minutos!") setGlobalStorageValue(27381, 0) addEvent(reloadCampoMinado, 1*60*1000) addEvent(StartCampoMinado, OpenTime*60*1000) return end return true end script lib -- This script is part of Campo Minado Event -- Copyright (C) 2017 By Ciroc Developer -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // -- CONFIGURACOES DO EVENTO CampoMinado_DAYS = {1,2,3,4,5,6,7} -- DIAS DA SEMANA QUE VAI ABRIR CampoMinado_STARTAUTO = true -- TRUE ATIVA/FALSE DESATIVA OpenTime = 5 -- TEMPO EM MINUTOS PARA O EVENTO INICIAR _Lib_CampoMinado_Info = { RewardPrimeiro = {11192,30}, -- RECOMPENSA/QUANTIDADE 1 COLOCADO RewardSegundo = {11192,20}, -- RECOMPENSA/QUANTIDADE 2 COLOCADO RewardTerceiro = {11192,10}, -- RECOMPENSA/QUANTIDADE 3 COLOCADO tpPos = {x=151, y=40, z=7}, -- POSICAO QUE ABRE O TP PerdeuPos = {x=1153, y=1183, z=7}, -- ULTIMA POSICAO ANTES DO TROFEU ExitPos = {x=154, y=50, z=7}, -- POSICAOO ONDE VAI AO SAIR DO EVENTO DestinoPos = {x=1173, y=1207, z=7}, -- POSICAO ENTRADA SALA DO EVENTO limit_Time = 15 -- LIMITE DE TEMPO EM MINUTOS } function OpenWallCampoMinado() local B = { {1304,{x=1163, y=1195, z=7, stackpos = 1}}, -- POSICAO DA PEDRA1 {1304,{x=1164, y=1195, z=7, stackpos = 1}}, -- POSICAO DA PEDRA2 {1304,{x=1165, y=1195, z=7, stackpos = 1}}, -- POSICAO DA PEDRA3 } for i = 1, #B do if getTileItemById(B[i][2], B[i][1]).uid == 0 then doCreateItem(B[i][1], 1, B[i][2]) else doRemoveItem(getThingfromPos(B[i][2]).uid,1) end end end function removeCampoMinadoTp() local t = getTileItemById(_Lib_CampoMinado_Info.tpPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_CampoMinado_Info.tpPos, CONST_ME_POFF) end function removeCampoMinadoResetPerdeu() local t = getTileItemById(_Lib_CampoMinado_Info.PerdeuPos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(_Lib_CampoMinado_Info.PerdeuPos, CONST_ME_POFF) end function StartCampoMinado() removeCampoMinadoTp() removeCampoMinadoResetPerdeu() reloadCampoMinado() doBroadcastMessage("{Campo Minado} Teleport fechado, evento ira iniciar em um minuto, crie sua estrategia!") addEvent(doBroadcastMessage, 1*60*1000, "{Campo Minado} Evento iniciado!") addEvent(OpenWallCampoMinado, 1*60*1000) end script movements chegada function onStepIn(cid, item, position, fromPosition) nomep = getCreatureName(cid) getFirstPlayer = function() for x = 478, 489 do for y = 621, 632 do local area = {x = x, y = y, z = 7} if getTopCreature(area) and getTopCreature(area).uid > 0 and isPlayer(getTopCreature(area).uid) then return getTopCreature(area).uid end end end end if getGlobalStorageValue(27381) == 1 then doTeleportThing(cid, _Lib_CampoMinado_Info.ExitPos) doBroadcastMessage("{Campo Minado} O jogador "..nomep.." foi o 2º a chegar no final do labirinto!") doPlayerAddItem(cid, _Lib_CampoMinado_Info.RewardSegundo[1], _Lib_CampoMinado_Info.RewardSegundo[2]) setGlobalStorageValue(27381, getGlobalStorageValue(27381)+1) elseif getGlobalStorageValue(27381) == 2 then doTeleportThing(cid, _Lib_CampoMinado_Info.ExitPos) doBroadcastMessage("{Campo Minado} O jogador "..nomep.." foi o 3º a chegar no final do labirinto!") setGlobalStorageValue(27381, 0) doPlayerAddItem(cid, _Lib_CampoMinado_Info.RewardTerceiro[1], _Lib_CampoMinado_Info.RewardTerceiro[2]) OpenWallCampoMinado() doCreateTeleport(1387, _Lib_CampoMinado_Info.DestinoPos, _Lib_CampoMinado_Info.PerdeuPos) local player = getFirstPlayer() doTeleportThing(player, getTownTemplePosition(getPlayerTown(player))) else doTeleportThing(cid, _Lib_CampoMinado_Info.ExitPos) doBroadcastMessage("{Campo Minado} O jogador "..nomep.." foi o 1º a chegar no final do labirinto!") doPlayerAddItem(cid, _Lib_CampoMinado_Info.RewardPrimeiro[1], _Lib_CampoMinado_Info.RewardPrimeiro[2]) setGlobalStorageValue(27381, 1) end return TRUE end script movements mina function onStepIn(cid, item, position, fromPosition) sorte = math.random(1,5) if getPlayerAccess(cid) <= 2 then if sorte == 1 then doSendMagicEffect(position,6) doTeleportThing(cid,{x=1164,y=1197,z=7}) doTransformItem(item.uid,1502) doSendAnimatedText(position,"BooomM",149) else doSendAnimatedText(position,"Ttlec",16) doSendMagicEffect(position,3) end end return TRUE end por favor ajudem a arrumar esses erros + rep
Postado Março 6, 2019 6 anos Autor 10 horas atrás, Pedrok22 disse: procura na pasta data/globalevents/scripts/CampoMinado .lua e procura por isso : Mostrar conteúdo oculto getThingfromPos e troque por esse aqui: Mostrar conteúdo oculto getThingfromPosition e salva e testa. esse erro acontece, por causa da distro sua distro, que sua distro dever ser OTX, nas sourcer do OTX não tem essa função >getThingfromPos, so vai ter > getThingfromPosition troquei a funçao ate la lib ai deu esse erro [Error - GlobalEvents::timer] Couldn't execute event: CampoMinado Mago Maguxx has logged out. [Error - GlobalEvent Interface] In a timer event called from: data/globalevents/scripts/CampoMinado.lua:onTime Description: data/globalevents/scripts/CampoMinado.lua:7: attempt to call global 'getThingfromPosition' (a nil value) stack traceback: data/globalevents/scripts/CampoMinado.lua:7: in function <data/globalevents/scripts/CampoMinado.lua:1>
Postado Março 7, 2019 6 anos Autor 10 horas atrás, Pedrok22 disse: essas coordenadas estão certas ? pq aqui no meu pego normal 00:43 {CampoMinado} O jogador Lord foi o 1º a chegar no final do labirinto! 00:44 {CampoMinado} O jogador Admin Genesis foi o 2º a chegar no final do labirinto! o evento acontece normal os players chega ate o final e e ganhão a recompensa . so fica dando esse erro na distro memo
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.