local centerPos = {x=math.min(ZE_spawnFromPosition.x, ZE_spawnToPosition.x)+width,y=math.min(ZE_spawnFromPosition.y, ZE_spawnToPosition.y)+height,z=ZE_spawnFromPosition.z}
for z = math.min(ZE_spawnFromPosition.z, ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z, ZE_spawnToPosition.z) do
centerPos.z = z
for i, uid in pairs(getSpectators(centerPos, width, height, false)) do
if(isMonster(uid)) then
doRemoveCreature(uid)
end
end
end
end
end
function onStatsChange(target, cid, changetype, combat, value)
if((cid and isMonster(cid) and getCreatureName(cid) == "Zombie Event") or (isInRange(getThingPosition(target), ZE_spawnFromPosition, ZE_spawnToPosition) and changetype == STATSCHANGE_HEALTHLOSS and math.abs(value) >= getCreatureHealth(target))) then
info
Grupo: Barão
Registrado: 24/03/11
Posts: 207
Reputação: +52
Char no Tibia: Lord Curitiibano
alguem ajuda aew, ta dando esse erro quando um monstro tenta me attaka:
[16/11/2012 20:27:12] [Error - CreatureScript Interface]
[16/11/2012 20:27:12] data/creaturescripts/scripts/zombie/onattack.lua:onStatsChange
[16/11/2012 20:27:12] Description:
[16/11/2012 20:27:12] data/lib/032-position.lua:2: attempt to index global 'position' (a nil value)
[16/11/2012 20:27:12] stack traceback:
[16/11/2012 20:27:12] data/lib/032-position.lua:2: in function 'isInRange'
[16/11/2012 20:27:12] data/creaturescripts/scripts/zombie/onattack.lua:35: in function <data/creaturescripts/scripts/zombie/onattack.lua:34>
creaturescripts/scripts/zombie/onattack.lua: