Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
1.6K
Fight Mode Toggle #39
Toggles current fight mode depending on amount of mobs around.
511b | 19 lines.
 --[[
  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
Ads