Eu baixei um Zombie Event na net, e está aparecendo um erro no distro além das mensagens de "boa sorte, quantos players entraram no TP e quanto tempo falta pro tp fechar".
Está configurado para os zombies serem spawnados a cada 20 segundos, mas após os primeiros 20 segundos, nenhum zombie spawna, e não aparece nenhum erro no distro.
Aqui vão os scripts:
globalevents/scripts/zombievent.lua
local 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 = 2008, -- Action id of the teleport needed for the movement script
teleportPosition = {x = 995, y = 1019, z = 7, stackpos = 1}, -- Where the teleport will be created
teleportToPosition = {x = 988, y = 955, z = 7}, -- Where the teleport will take you
teleportId = 1387, -- Id of the teleport
timeToStartEvent = 1, -- 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 = 1, -- Players needed before the zombies can spawn.
fromPosition = {x = 974, y = 943, z = 7}, -- top left cornor of the playground
toPosition = {x = 1002, y = 967, z = 7}, -- bottom right cornor of the playground
}
function onTime()
local tp = doCreateTeleport(config.teleportId, config.teleportToPosition, config.teleportPosition)
doBroadcastMessage("Zombie event starting in " .. config.timeToStartEvent .. " minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
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)
doBroadcastMessage("A zombie has spawned! There is currently " .. getGlobalStorageValue(config.zombieCount) .. " zombies in the zombie event!", MESSAGE_STATUS_CONSOLE_RED)
playerCount = 2001, -- Global storage for counting the players left/entered in the event
goblet = 5805, -- id of the gold goblet you'll get when finishing the event.
rewards = {2195, 2152, 2160}, -- You will get this + a gold goblet with your name on.
-- {moneyId, count, using? 1 for using moneyReward, 0 for not using.}
moneyReward = {2160, 10, 1}, -- second collumn(count) 0 if you don't want money to be used. or a stackable item you want more than 1 of.
-- Should be same as in the globalevent!
-- The zombies will spawn randomly inside this area
fromPosition = {x = 974, y = 943, z = 7}, -- top left cornor of the playground
toPosition = {x = 1002, y = 967, z = 7}, -- bottom right cornor of the playground
}
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(cid) and isMonster(attacker) then
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
if getGlobalStorageValue(config.playerCount) >= 2 then
doBroadcastMessage(getPlayerName(cid) .. " have been eated by Zombies!", MESSAGE_STATUS_CONSOLE_RED)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
elseif getGlobalStorageValue(config.playerCount) == 1 then
if isInArea(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
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.")
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
Pergunta
jvcasarin 56
Bom gente, vou ser rapido e direto:
Eu baixei um Zombie Event na net, e está aparecendo um erro no distro além das mensagens de "boa sorte, quantos players entraram no TP e quanto tempo falta pro tp fechar".
Erro:
Está configurado para os zombies serem spawnados a cada 20 segundos, mas após os primeiros 20 segundos, nenhum zombie spawna, e não aparece nenhum erro no distro.
Aqui vão os scripts:
globalevents/scripts/zombievent.lua
creaturescripts/scripts/zombievent.lua
monsters/Zombie Event/Event zombie.xml
movements/scripts/zombievent.lua
Por favor me ajudem!
up
Editado por jvcasarinLink para o comentário
Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados