Fight Mode Toggle
#39
Toggles current fight mode depending on amount of mobs around.
--[[
Script made by Lee (Discord: l33_) - www.trainorcreations.com
If you want to support my work, feel free to donate at https://trainorcreations.com/donate
PS. Stop ripping off my work and selling it as your own.
]]--
local fightmode = 1
macro(500, "Fight Mode Toggle", function()
if isInPz() then return end
local monsters = 0
for i, mob in ipairs(getSpectators(posz())) do
if mob:isMonster() and getDistanceBetween(player:getPosition(), mob:getPosition()) ==1 then
monsters = monsters + 1
end
end
if monsters >= 4 then
fightmode = 3
else
fightmode = 1
end
if fightmode ~= g_game.getFightMode() then
g_game.setFightMode(fightmode)
end
end)
12 Jun 2021