Ir para conteúdo
  • 0

Erro no zombie event


Pergunta

Boa Tarde Xtibia!

Gostaria de saber se alguém conhece o Zombie Event, é um evento automático quando da a hora de executar ele aparece um erro no meu distro alguém poderia arrumar para mim?

estou usando o Distro tfs 0.4 servidor 8.60

Aqui esta o erro que aparece no distro, e abaixo colocarei o script.

15/02/2016 15:32:00] > Broadcasted message: "Zombie event starting in 5 minutes! The teleport will be closed when the event start!".
[15/02/2016 15:32:00] 0
[15/02/2016 15:32:00] [Error - GlobalEvents::timer] Couldn't execute event: zombieevent
[15/02/2016 15:32:04] > Broadcasted message: "GOD entered the Zombie event! Currently 1 players have joined!".
[15/02/2016 15:32:04] 1 Players in the zombie event.
[15/02/2016 15:37:00] > Broadcasted message: "Good luck in the zombie event people! The teleport has closed!".

Script da pasta globalevents

local config = {
playerCount = 2001, -- armazenamento global para contar os jogadores para a esquerda / inscrito no evento
zombieCount = 2002, -- armazenamento global para contar os zumbis no caso
teleportActionId = 2000, -- ID de ação do teletransporte necessário para o script movimento
teleportPosition = {x = 434, y = 546, z = 7, stackpos = 1}, -- Onde o teletransporte será criado
teleportToPosition = {x = 514, y = 373, z = 7}, -- Aonde o portal vai levá-lo
teleportId = 1387, -- Id do teletransporte
timeToStartEvent = 5, -- Minutos, após estas minutos o teletransporte será removido e o evento será declarado começou
timeBetweenSpawns = 15, -- Segundos entre cada desova de zumbi
zombieName = "zombie_event", -- Nome do zumbi que deve ser convocado
playersNeededToStartEvent = 15, -- Jogadores necessários antes que os zumbis podem desovar.


-- Deve ser o mesmo que na creaturescript!
-- Os zumbis vão aparecer aleatoriamente dentro desta área
fromPosition = {x = 479, y = 345, z = 7}, -- canto superior esquerdo do campo de jogos
toPosition = {x = 542, y = 397, z = 7}, -- canto inferior direito do campo de jogos
}


function onTimer()
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)
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("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, stackpos = 253}
getPlayers = getThingfromPos(areapos)
if isPlayer(getPlayers.uid) then
doPlayerSendTextMessage(getPlayers.uid, MESSAGE_EVENT_ADVANCE, "The first zombie will spawn in " .. config.timeBetweenSpawns .. " seconds! Good luck!")
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, 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("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED)
addEvent(spawnZombie, config.timeBetweenSpawns * 1000)
end
end

 

Link para o comentário
https://xtibia.com/forum/topic/239468-erro-no-zombie-event/
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Tópico Movido
Este tópico foi movido de "OTServScriptingDownloads ScriptsGlobalevents, spells e creatureevents"
para "OTServScriptingSuporte Scripting".

 

 

Link para o comentário
https://xtibia.com/forum/topic/239468-erro-no-zombie-event/#findComment-1688259
Compartilhar em outros sites

×
×
  • Criar Novo...