10-20-2013, 03:29 PM
Doesnt seem to be working for me..
function GetNearestGrindAttackable()
local minLevel = tostring(Player.level - tonumber(gMinMobLevel))
local maxLevel = tostring(Player.level + tonumber(gMaxMobLevel))
local el = EntityList("lowesthealth,alive,contentid=411,attackable,onmesh,maxdistance="..tostring(ml_global_information.AttackRange)..",minlevel="..minLevel..",maxlevel="..maxLevel)
if ( el ) then
local i,e = next(el)
if (i~=nil and e~=nil) then
return e
end
end
local el = EntityList("nearest,contentid=411,alive,attackable,onmesh,minlevel="..minLevel..",maxlevel="..maxLevel)
if ( el ) then
local i,e = next(el)
if (i~=nil and e~=nil) then
return e
end
end
ml_debug("GetNearestAttackable() failed with no entity found matching params")
return nil
end
still is attacking everything o.o
function GetNearestGrindAttackable()
local minLevel = tostring(Player.level - tonumber(gMinMobLevel))
local maxLevel = tostring(Player.level + tonumber(gMaxMobLevel))
local el = EntityList("lowesthealth,alive,contentid=411,attackable,onmesh,maxdistance="..tostring(ml_global_information.AttackRange)..",minlevel="..minLevel..",maxlevel="..maxLevel)
if ( el ) then
local i,e = next(el)
if (i~=nil and e~=nil) then
return e
end
end
local el = EntityList("nearest,contentid=411,alive,attackable,onmesh,minlevel="..minLevel..",maxlevel="..maxLevel)
if ( el ) then
local i,e = next(el)
if (i~=nil and e~=nil) then
return e
end
end
ml_debug("GetNearestAttackable() failed with no entity found matching params")
return nil
end
still is attacking everything o.o