• 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!

TFS 1.X+ [ACTION][HELP] boss remover

Hyagosrs

Member
Joined
Mar 10, 2018
Messages
94
Solutions
1
Reaction score
11
i need to remove boss everytime i pull the lever to kill only one.
i tried everything, i tried another parameter that i have, and nothing works.. this is lloydlever.lua

Lua:
local config = {
    centerRoom = Position(32799, 32832, 14),
    BossPosition = Position(32799, 32827, 14),
    newPosition = Position(32800, 32831, 14)
}

local monsters = {
    {cosmic = 'cosmic energy prism a', pos = Position(32801, 32827, 14)},
    {cosmic = 'cosmic energy prism b', pos = Position(32798, 32827, 14)},
    {cosmic = 'cosmic energy prism c', pos = Position(32803, 32826, 14)},
    {cosmic = 'cosmic energy prism d', pos = Position(32796, 32826, 14)}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 9825 then
        if player:getPosition() ~= Position(32759, 32868, 14) then
            item:transform(9826)
            return true
        end
    end
    if item.itemid == 9825 then
    
        local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting with Lloyd.")
                return true
            end
        end
        for n = 1, #monsters do
            Game.createMonster(monsters[n].cosmic, monsters[n].pos, true, true)
        end
        Game.createMonster("lloyd", config.BossPosition, true, true)
        for y = 32868, 32872 do
            local playerTile = Tile(Position(32759, y, 14)):getTopCreature()
            if playerTile and playerTile:isPlayer() then
                playerTile:getPosition():sendMagicEffect(CONST_ME_POFF)
                playerTile:teleportTo(config.newPosition)
                playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                playerTile:setExhaustion(Storage.ForgottenKnowledge.LloydTimer, 30)
            end
        end
        item:transform(9826)
    elseif item.itemid == 9826 then
        item:transform(9825)
    end
    return true
end
 
Back
Top