What is wrong with that action? I want to rule monster to x place and then change state to the keep away. Could anyone help me?

PHP Code:
local Area = {
    {{
3309033098}, {3310033090}, 6},
}
function 
ShootArea()
     for 
iShootArea in ipairs(Area) do
            if (
posx >= Area[1][1] and posy >= Area[1][2] and posx <= Area[2][1] and posy <= Area[2][2] and posz == Area[3]) then
           
return true
             end
     end
return false
end

if target.id ~= 0 then
      setlurelocation
(33092330926)

      if 
not ShootArea then
    setsettings
("Settings\\Targeting\\Monsters\\Dragon Lord\\ListSettings\\Setting0\\Stance""Lure")
    
 elseif 
ShootArea then

setsettings
("Settings\\Targeting\\Monsters\\Dragon Lord\\ListSettings\\Setting0\\Stance""Keep Away")

      
end
end