Postado Outubro 27, 2017 7 anos Spoiler local center = Position(1,1,1) local varX, varY = 5,5 local effect = CONST_ME_TELEPORT local min, max = 100, 300 function onThink(interval) local f = Position(center.x-varX, center.y-varY, center.z) local t = Position(center.x+varX, center.y+varY, center.z) iterateArea(function(p) if (p.x == center.x or p.y == center.y) and p ~= center then p:sendMagicEffect(effect) local tile = Tile(p) if tile then local creature = tile:getTopCreature() if creature and creature:isPlayer() then local value = -math.random(min, max) creature:addHealth(value) end end end end, f, t) return true end function iterateArea(func, from, to) for z = from.z, to.z do for y = from.y, to.y do for x = from.x, to.x do func(Position(x, y, z)) end end end end No globalevents.xml: <globalevent name="EfeitoChao" interval="3000" script="NOMEDOARQUIVO.lua" /> Contato: Email: [email protected] Discord: Dwarfer#2715
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.