Ir para conteúdo

Posts Recomendados

Olá Galera, vim aqui pedir a ajuda de vocês, pois não consigo resolver um problema

com o evento "Zombie Event" ...

O problema é o seguinte, quando inicio o evento normalmente, o evento não detecta que tal player entrou, então fecha sozinho olhei no consoler e o erro é esse

 

[Error - CreatureScropt Interface]

data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange

Description:

data/lib/032-position.lua:2: attept to index global 'position' (a nil value)

stack traceback:

data/lib/032-position.lua:2: in function 'isInRange'

data/creaturescripts/scripts/zombie/onattack.lua:35: in function (data/creaturescripts/scripts/zombie/onattack.lua:34)

 

 

O mapa que uso é o mapa Heroserv (8.60), e o site que peguei essa script é : http://otland.net/f82/zombie-event-new-version-bug-free-updated-128664/ Preciso da ajuda de vocês gente, Desculpem se fiz algo errado, ou se postei lugar errado, mas me ajudem Att ,New Xtibiano Élli

Editado por elli
Link para o comentário
https://xtibia.com/forum/topic/175662-preciso-de-sua-ajuda-sobre-o-event-zombie/
Compartilhar em outros sites

Po cara, você tem que por um u.id no tile em que o player entra para contabilizar.

 

Posta seu código ai que eu te ajudo.

  • rep_up.png
  • rep_down.png
  • 0

Po cara, você tem que por um u.id no tile em que o player entra para contabilizar.

 

Posta seu código ai que eu te ajudo.

 

 

Como assim véiu ?? Que código que é pra mim postar ??? Me add msn ai que é melhor maninho eliton_cnb@hotmail.com.br

 

Pelo que entendi, acho que é esse o codigo que pedisse...

vo manda ai pra vc da uma olhadinha Obs: Eu ja botei tudo as positions e tals só não sei essa prada do u.id que falasse ai !!

 

 

-- CONFIG

ZE_DEFAULT_NUMBER_OF_PLAYERS = 5

ZE_ACCESS_TO_IGNORE_ARENA = 3

-- POSITIONS

ZE_blockEnterItemPosition = {x= 10153, y=10045, z=7}

ZE_enterPosition = {x = 10284, y = 9996, z = 7}

ZE_kickPosition = {x=10159, y=10054, z=7}

ZE_spawnFromPosition = {x = 10261, y = 9984, z = 7}

ZE_spawnToPosition = {x = 10309, y = 10008, z = 7}

-- ITEM IDS

ZE_blockEnterItemID = 2700

-- STORAGES

-- - player

ZE_isOnZombieArea = 34370

-- - global

ZE_STATUS = 34370 -- =< 0 - off, 1 - waiting for players, 2 - is running

ZE_PLAYERS_NUMBER = 34371

ZE_ZOMBIES_TO_SPAWN = 34372

ZE_ZOMBIES_SPAWNED = 34373

 

-- FUNCTION

 

function setZombiesEventPlayersLimit(value)

doSetStorage(ZE_PLAYERS_NUMBER, value)

end

 

function getZombiesEventPlayersLimit()

return getStorage(ZE_PLAYERS_NUMBER)

end

 

function addPlayerToZombiesArea(cid)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

doTeleportThing(cid, ZE_enterPosition, true)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

if(getPlayerAccess(cid) < ZE_ACCESS_TO_IGNORE_ARENA) then

setPlayerZombiesEventStatus(cid, os.time())

end

end

 

function kickPlayerFromZombiesArea(cid)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

doTeleportThing(cid, ZE_kickPosition, true)

doSendMagicEffect(getThingPosition(cid), CONST_ME_TELEPORT)

setPlayerZombiesEventStatus(cid, 0)

end

 

function getPlayerZombiesEventStatus(cid)

return getCreatureStorage(cid, ZE_isOnZombieArea)

end

 

function setPlayerZombiesEventStatus(cid, value)

doCreatureSetStorage(cid, ZE_isOnZombieArea, value)

end

 

function getZombiesEventPlayers()

local players = {}

for i, cid in pairs(getPlayersOnline()) do

if(getPlayerZombiesEventStatus(cid) > 0) then

table.insert(players, cid)

end

end

return players

end

 

function getZombiesCount()

return getStorage(ZE_ZOMBIES_SPAWNED)

end

 

function addZombiesCount()

doSetStorage(ZE_ZOMBIES_SPAWNED, getStorage(ZE_ZOMBIES_SPAWNED)+1)

end

 

function resetZombiesCount()

doSetStorage(ZE_ZOMBIES_SPAWNED, 0)

end

 

function getZombiesToSpawnCount()

return getStorage(ZE_ZOMBIES_TO_SPAWN)

end

 

function setZombiesToSpawnCount(count)

doSetStorage(ZE_ZOMBIES_TO_SPAWN, count)

end

 

function addZombiesEventBlockEnterPosition()

if(getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID).uid == 0) then

doCreateItem(ZE_blockEnterItemID, 1, ZE_blockEnterItemPosition)

end

end

 

function removeZombiesEventBlockEnterPosition()

local item = getTileItemById(ZE_blockEnterItemPosition, ZE_blockEnterItemID)

if(item.uid ~= 0) then

doRemoveItem(item.uid)

end

end

 

function spawnNewZombie()

local posx = {}

local posy = {}

local posz = {}

local pir = {}

for i=1, 5 do

local posx_tmp = math.random(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x)

local posy_tmp = math.random(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y)

local posz_tmp = math.random(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z)

local pir_tmp = 0

local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false)

if(spec and #spec > 0) then

for z, pid in pairs(spec) do

if(isPlayer(pid)) then

pir_tmp = pir_tmp + 1

end

end

end

posx = posx_tmp

posy = posy_tmp

posz = posz_tmp

pir = pir_tmp

end

local lowest_i = 1

for i=2, 5 do

if(pir < pir[lowest_i]) then

lowest_i = i

end

end

local ret = (type(doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false)) == 'number')

if(ret) then

addZombiesCount()

end

return ret

end

Link para o comentário
https://xtibia.com/forum/topic/175662-preciso-de-sua-ajuda-sobre-o-event-zombie/#findComment-1155771
Compartilhar em outros sites

×
×
  • Criar Novo...