• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Added attacking with spell

Fabryka

New Member
Joined
Mar 3, 2025
Messages
1
Reaction score
0
Hello, I have a script to attack mobs and attack them with autoattacks, how can I add to this script so that it also attacks with a spell called "dark illusion"?

local distance = 12
macro(100, "EASYSTONE", function()
if isInPz() then return end
if g_game.isAttacking() then return end

local highestAmount = 100
local mob

for i, val in pairs(getSpectators()) do
if val:isMonster() and val:canShoot() then
if getDistanceBetween(player:getPosition(), val:getPosition()) <= distance then
local valHp = val:getHealthPercent()
if valHp <= highestAmount then
highestAmount = valHp
mob = val
end
end
end
end
if mob then
g_game.attack(mob)
end
end)
 
Back
Top