Ir para conteúdo
  • 0

colocar pro monster passar no tile


Pergunta

alguem poderia ponhar pro monstro poder passar no tile desse script , monstro não passa apenas players

 

 

 

local tilepos = {x=2015, y=2074, z=12} -- Posiçao do tile noroeste ( /\ < )
local sq = 3 -- Area 3x3 usar somente numeros impares > 2
local monster = "Morgaroth2"
local time = 2 -- Tempo em minutos pra desaparecer
function getUidsInArea(extr1, extr2)
local dat = {}
for y = extr1.y, extr2.y do
for x = extr1.x, extr2.x do
if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then
table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid)
end
end
end
return dat
end
function summonAndRemove(monster, pos, t)
local function removeCreatureEvent(uid)
if isCreature(uid) then
doRemoveCreature(uid)
end
end
local uid = doSummonCreature(monster, pos)
addEvent(removeCreatureEvent, t*1000, uid)
end
function onStepIn(cid, item, pos, frompos)
if sq < 3 or sq%2 == 0 then
return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2")
end
local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z})
if #uids == 0 then
for y = tilepos.y, tilepos.y+sq-1 do
for x = tilepos.x, tilepos.x+sq-1 do
if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then
doTeleportThing(cid, {x=x, y=y, z=tilepos.z})
else
summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60)
end
end
end
else
doTeleportThing(cid,frompos,true)
return doPlayerSendCancel(cid, "Há pessoas lá dentro agora.")
end
end

REP++
Editado por Dennyz Dias
Link para o comentário
https://xtibia.com/forum/topic/238418-colocar-pro-monster-passar-no-tile/
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...