Postado Junho 14, 2015 9 anos Boa Noite, Estou com um Problema Serio! Quando inicio o servidor ou dou /reload globalevents Me deparo com este erro: [Warning - Event::loadScript] Event onTime not found (data/globalevents/scripts/zombie_event.lua) Não sei bem oque fazer, ja tentei por OnTrink e tudo mais , não funcionou! Script! ocal 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 = 32364, y = 32232, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 32324, y = 31941, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 5, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 20, -- Seconds between each spawn of zombie zombieName = "event zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 5, -- Players needed before the zombies can spawn. -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 32298, y = 31915, z = 7}, -- top left cornor of the playground toPosition = {x = 32357, y = 31970, z = 7}, -- bottom right cornor of the playground } function onTimer() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie Event iniciara em " .. config.timeToStartEvent .. " Minutos! O Teleporte sera fechado quando der inicio ao Evento!", MESSAGE_STATUS_WARNING) 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) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Boa Sorte Participantes! O Teleporte Foi Fechado", 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, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "Os Primeiros Zombie Vao aparecer em " .. config.timeBetweenSpawns .. " Segundos! Boa Sorte!") end end end end else doBroadcastMessage("O Evento Zombie nao pode iniciar devido a alguns Participantes.\n Pelo Menos " .. config.playersNeededToStartEvent .. " Participantes Necessarios!", 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, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) 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("Um Zombie Tem Gerado! Nao Existe Atualmente " .. getGlobalStorageValue(config.zombieCount) .. " Zombie em Caso Zombies!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end Tag! <globalevent name="zombieevent" time="04:00" event="script" value="zombie_event.lua"/> Valendo REP! Editado Junho 14, 2015 9 anos por PobrePreto (veja o histórico de edições) "Ainda que eu ande pelo vale da sombra da morte, não temerei mal algum, pois tu estás comigo. Salmos 23:4"
Postado Junho 14, 2015 9 anos Solução tenta assim amigo. ocal 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 = 32364, y = 32232, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 32324, y = 31941, z = 7}, -- Where the teleport will take you teleportId = 1387, -- Id of the teleport timeToStartEvent = 5, -- Minutes, after these minutes the teleport will be removed and the event will be declared started timeBetweenSpawns = 20, -- Seconds between each spawn of zombie zombieName = "event zombie", -- Name of the zombie that should be summoned playersNeededToStartEvent = 5, -- Players needed before the zombies can spawn. -- Should be the same as in the creaturescript! -- The zombies will spawn randomly inside this area fromPosition = {x = 32298, y = 31915, z = 7}, -- top left cornor of the playground toPosition = {x = 32357, y = 31970, z = 7}, -- bottom right cornor of the playground } function onTime() local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition) doItemSetAttribute(tp, "aid", config.teleportActionId) doBroadcastMessage("Zombie Event iniciara em " .. config.timeToStartEvent .. " Minutos! O Teleporte sera fechado quando der inicio ao Evento!", MESSAGE_STATUS_WARNING) 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) end local fromp, top = config.fromPosition, config.toPosition if getGlobalStorageValue(config.playerCount) >= config.playersNeededToStartEvent then addEvent(spawnZombie, config.timeBetweenSpawns * 1000) doBroadcastMessage("Boa Sorte Participantes! O Teleporte Foi Fechado", 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, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "Os Primeiros Zombie Vao aparecer em " .. config.timeBetweenSpawns .. " Segundos! Boa Sorte!") end end end end else doBroadcastMessage("O Evento Zombie nao pode iniciar devido a alguns Participantes.\n Pelo Menos " .. config.playersNeededToStartEvent .. " Participantes Necessarios!", 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, stackpos = 253} getPlayers = getThingfromPos(areapos) if isPlayer(getPlayers.uid) then doTeleportThing(getPlayers.uid, getTownTemplePosition(getPlayerTown(getPlayers.uid)), false) 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("Um Zombie Tem Gerado! Nao Existe Atualmente " .. getGlobalStorageValue(config.zombieCount) .. " Zombie em Caso Zombies!", MESSAGE_STATUS_CONSOLE_RED) addEvent(spawnZombie, config.timeBetweenSpawns * 1000) end end I like
Postado Junho 14, 2015 9 anos Autor Funcionou perfeitamente, Agora vou Testar o Evento! "Ainda que eu ande pelo vale da sombra da morte, não temerei mal algum, pois tu estás comigo. Salmos 23:4"
Postado Julho 1, 2015 9 anos Em 14/06/2015 em 13:08, PobrePreto disse: Funcionou perfeitamente, Agora vou Testar o Evento! eai funcionou ?
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.