TFS 02 VERSION TIBIA 9.6 Que tal alguien me podria apoyar reparando este script de un helmeth que crea dos efectos alrededor del player uno dentro de pz y otro fuera de pz alrededor del player y hace un poco de daño al que le pegue, al caminar el player el efecto sigue saliendo alrededor de el ABAJO COLOCO EL ERROR QUE ME SALE EN CONSOLA:

Muchas Gracias. TFS 02 VERSION TIBIA 9.6
JavaScript:
local Config = {
PZ = { -- Efectos en Zona protegida
CONST_ANI_ENERGY, -- Efecto mágico a distancia
CONST_ME_PURPLEENERGY, -- Efecto mágico normal
},
PVP = { -- Efectos en Zona NO protegida
CONST_ANI_FIRE, -- Efecto mágico a distancia
CONST_ME_FIREAREA, -- Efecto mágico normal
},
Outfit = {336, 335}, -- Traje femenino, Traje masculino
Combat = COMBAT_FIREDAMAGE, -- Tipo de daño elemental
Time = 150, -- Milisegundos que tardará en aparecer cada golpe
Direction = {NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST}, -- Direciones a las que irá cada golpe. (Puedes cambiar el orden)
}
local function canEffect(pos, proj) -- Night Wolf based on Nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then
return false
end
local n = not proj and 3 or 2
for i = 1, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
local function loop(delay, cid, times, burst, item, slot)
local Belero, fonte = {}, {}
if times <= table.maxn(Config.Direction) then
if isPlayer(cid) and getPlayerSlotItem(cid, slot).itemid == item.itemid then
local Formula = {
min = (getPlayerLevel(cid) * 1 + getPlayerMagLevel(cid) * 1) * 0.5,
max = (getPlayerLevel(cid) * 1 + getPlayerMagLevel(cid) * 1) * 2,
}
local toPosition = getPositionByDirection(getThingPos(cid), Config.Direction[times], 1)
if canEffect(toPosition, true) then
if getTileInfo(toPosition).protection or getTileInfo(getThingPos(cid)).protection then
Belero, fonte = Config.PZ[1], Config.PZ[2]
else
Belero, fonte = Config.PVP[1], Config.PVP[2]
doAreaCombatHealth(cid, Config.Combat, toPosition, 0, - Formula.min, - Formula.max, CONST_ME_NONE)
end
doSendDistanceShoot(getThingPos(cid), toPosition, Belero)
doSendMagicEffect(toPosition, fonte)
end
else
return true
end
times, burst = times + 1, burst + 100
addEvent(loop, delay, delay, cid, times, burst, item, slot)
else
loop(delay, cid, 1, burst, item, slot)
end
return true
end
function onEquip(cid, item, slot)
local outfit = getCreatureOutfit(cid)
outfit.lookType = getPlayerSex(cid) > 0 and Config.Outfit[2] or Config.Outfit[1]
doSetCreatureOutfit(cid, outfit, -1)
loop(Config.Time, cid, 1, 0, item, slot)
return true
end
function onDeEquip(cid, item, slot)
doRemoveCondition(cid, CONDITION_OUTFIT)
return true
end

Muchas Gracias. TFS 02 VERSION TIBIA 9.6