data\movements\scripts\nomedoscript.lua:
local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < )
local sq = 3 -- Area 3x3 usar somente numeros impares > 2
local monster = "Demon"
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, "There are people inside right now.")
end
end
xml:
<movevent type="StepIn" actionid="2930" event="script" value="nomedoscript.lua"/>






info
Grupo: Cavaleiro
Registrado: 17/06/15
Posts: 177
Reputação: +9
Char no Tibia: GOD Server
alguem me ajuda num script, estou fasendo uma quest
o script consiste em
player Pisa Tal piso e teleportado para lugar X e sumona com ele 8 monstro soq depois de 2 minutos os monstro sumonados sejao retirados
Obrigado REP++