Postado Fevereiro 12, 2017 8 anos Autor Vod, voltou aquele erro... Ta assim o evento: Spawna 1 zombie e manda esse erro [20:17:20.449] [Warning - Monster::Monster] Unknown event name - ZombieThink [20:17:20.452] [Warning - Monster::Monster] Unknown event name - ZombieDeath Ai spawna outro zombie e manda esse erro [20:15:40.331] [Warning - Monster::Monster] Unknown event name - ZombieThink [20:15:40.337] [Warning - Monster::Monster] Unknown event name - ZombieDeath [20:15:40.340] [Error - GlobalEvent Interface] [20:15:40.342] In a timer event called from: [20:15:40.345] data/globalevents/scripts/z.lua:onTime [20:15:40.348] Description: [20:15:40.350] (LuaInterface::luaDoCreateMonster) Cannot create monster: Zombie Event Aqui ta o script.. Mostrar conteúdo oculto local config = { semana_mes = "semana", days = {1,2,3,4,5,6,7}, -- Dia das semanas que ira acontecer o evento goblet = 5805, -- Trofeu que vai pro vencedor do evento rewards = {7440}, -- Recompensas. moneyReward = {9971, 10, 1},-- {moneyId, quantidade, usar}1 pra usar 0 pra nao usar} playerCount = 2001, -- Storage dos players que entram e sai do evento zombieCount = 2002, -- Storage do zombie do event teleportActionId = 2008, -- Action ID do teleport teleportPosition = {x = 10160, y = 10054, z = 7, stackpos = 1}, -- Onde o teleport e criado teleportToPosition = {x = 9930, y = 10105, z = 7}, -- Pra onde sera teleportado teleportId = 1387, -- ID do teleporte timeToStartEvent = 1, -- Minutos que o portal ira ficar aberto ate os player entrarem timeBetweenSpawns = 20, -- Segundos dps do evento ser startado comecarem a aparecer os zombie zombieName = "Zombie Event", -- Nome do zombie sumonado playersNeededToStartEvent = 2, -- Players necessarios pro evento ser iniciado fromPosition = {x = 9896, y = 10074, z = 7}, -- top de fromPosition toPosition = {x = 9970, y = 10142, z = 7} -- -- em baixo toPostion } function onTime() local time = os.date("*t") if (config.semana_mes == "semana" and isInArray(config.days,time.wday)) or (config.semana_mes == "mes" and isInArray(config.days,time.day)) or config.semana_mes == "" then local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) setGlobalStorageValue(config.playerCount, 0) setGlobalStorageValue(config.zombieCount, 0) addEvent(startEvent, config.timeToStartEvent * 1000 * 60) end return TRUE end function startEvent() local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Good luck in the zombie event people! The teleport has closed!", MESSAGE_STATUS_WARNING) 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} local m = getTopCreature(areapos).uid if isPlayer(m) then doPlayerSendTextMessage(m, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!") pvgaylord() end end end end else doBroadcastMessage("The Zombie event could not start because of to few players participating.\n At least " .. config.playersNeededToStartEvent .. " players is needed!", MESSAGE_STATUS_WARNING) 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} local m = getTopCreature(areapos).uid if isPlayer(m) then doTeleportThing(m, getTownTemplePosition(getPlayerTown(m)), false) doSendMagicEffect(getPlayerPosition(m), 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)} local var = doCreateMonster(config.zombieName, pos, false) if var == false then return LUA_ERROR end doSendMagicEffect(pos, CONST_ME_MORTAREA) setGlobalStorageValue(config.zombieCount, getGlobalStorageValue(config.zombieCount)+1) doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) else local fromp, top = config.fromPosition, config.toPosition 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} local cid = getTopCreature(areapos).uid if isPlayer(cid) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doBroadcastMessage(getCreatureName(cid)..' has survived at zombie event!') for _,items in ipairs(config.rewards) do doPlayerAddItem(cid, items, 1) doPlayerAddItem(cid, 8306, 4) end if config.moneyReward[3] == 1 then doPlayerAddItem(cid, config.moneyReward[1], config.moneyReward[2]) end doBroadcastMessage(getPlayerName(cid) .. " won the Zombie event! Congratulations!", MESSAGE_STATUS_WARNING) local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") elseif isMonster(cid) then doRemoveCreature(cid) end end end end end end function pvgaylord() local fromp, top, p, m = config.fromPosition, config.toPosition, 0, 0 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} local m = getTopCreature(areapos).uid if isPlayer(m) then p = p+1 elseif isMonster(m) then m = m+1 end end end end if p ~= getGlobalStorageValue(config.playerCount) then setGlobalStorageValue(config.playerCount, p) end if p < 2 then return true end addEvent(pvgaylord,100,nil) end
Postado Fevereiro 14, 2017 8 anos olha, eu me comprometo a refazer um zombie system automático para 8.6, vou usar esse como base e criar um outro... afinal, o erro acontece porque? o nome do monstro da certo? estou refazendo o sistema, já fiz a lib, global events(para ficar automatico), tile zombie_config = { storages = {172200, 172201}, -- n edite players = {min = 2, max = 20}, -- min, max players no evento rewards = {items ={{2173,1},{2494,1}}, money = 1000, trophy = 5805}, -- premiações timeToStartEvent = 30, -- segundos para começar o evento CheckTime = 5, -- tempo que o TP fica aberto para os jogadores adrentarem o evento teleport = {{x=158, y=53, z=7}, {x=189 , y=58, z=7}}, -- posição do teleport, posição para onde o jogador vai arena = {{x=186,y=54,z=7},{x=193,y=60,z=7}}, -- posição começo e final da area monster_name = "", min_Level = 20 } zombie_days = { ["Monday"] = {"13:00","18:00","20:00","22:00"}, ["Tuesday"] = {"13:00","18:00","20:00","22:00"}, ["Wednesday"] = {"13:00","18:00","20:00","22:00"}, ["Thursday"] = {"13:00","18:00","20:00","22:00"}, ["Friday"] = {"13:00","18:00","21:45","22:00"}, ["Saturday"] = {"13:00","18:00","20:00","22:00"}, ["Sunday"] = {"13:00","18:00","20:00","22:00"} } function removeZombieTp() local t = getTileItemById(zombie_config.teleport[1], 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(zombie_config.teleport[1], CONST_ME_POFF) end function getPlayersInZombieEvent() local t = {} for _, pid in pairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), zombie_config.arena[1], zombie_config.arena[2]) then t[#t+1] = pid end end return t end -- automatic function onThink(interval, lastExecution) if zombie_days[os.date("%A")] then local hrs = tostring(os.date("%X")):sub(1, 5) if isInArray(zombie_days[os.date("%A")], hrs) then local tp = doCreateItem(1387, 1, zombie_config.teleport[1]) doItemSetAttribute(tp, "aid", 45100) CheckZombieEvent(zombie_config.CheckTime) setGlobalStorageValue(zombie_config.storages[1], 0) end end return true end -- end
Postado Fevereiro 14, 2017 8 anos Autor O nome do monstro ta certo, tanto que spawna eles mas da o erro mesmo assim Cara, vc é foda '-' pqp eu ia pedir pra colocar tbm a configuração para quais dias e em quais horarios ligar o evento e vc ja colocou hauhauah timeToStartEvent = 30, -- segundos para começar o evento também é o tempo que demora pro spawn dos zombies? Tem como deixar os rewards com isso também: local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") ? Uma observação: Eu to usando um zombie event por talkaction /zombiestart X -- X é a quantidade de players pro evento /zombiestart force -- forçar o inicio msm q n tenha X players Eu tava querendo corrigir os erros desse zombie do tópico pra poder iniciar o evento tanto manualmente quanto automaticamente... Vc consegue fazer isso?
Postado Fevereiro 14, 2017 8 anos Em 14/02/2017 em 16:50, Sekk disse: O nome do monstro ta certo, tanto que spawna eles mas da o erro mesmo assim Cara, vc é foda '-' pqp eu ia pedir pra colocar tbm a configuração para quais dias e em quais horarios ligar o evento e vc ja colocou hauhauah timeToStartEvent = 30, -- segundos para começar o evento também é o tempo que demora pro spawn dos zombies? Tem como deixar os rewards com isso também: local goblet = doPlayerAddItem(cid, config.goblet, 1) doItemSetAttribute(goblet, "description", "Awarded to " .. getPlayerName(cid) .. " for winning the Zombie event.") ? Uma observação: Eu to usando um zombie event por talkaction /zombiestart X -- X é a quantidade de players pro evento /zombiestart force -- forçar o inicio msm q n tenha X players Eu tava querendo corrigir os erros desse zombie do tópico pra poder iniciar o evento tanto manualmente quanto automaticamente... Vc consegue fazer isso? do goblet a alteração eu faço sem problemas, quanto a parte de começar manual ou automática eu posso fazer tbm, assim que eu terminar eu posto na comunidade e anexo o link no tópico. obs: eu acho que não vou fazer por MODS, porque entra em conflitos com outros códigos...
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.