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

action item:transform problem

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
529
Reaction score
56
TFS 1.2
why it doesnt reset pulled lewer? actionid items ids are correct
Lua:
function doResetAnnihilator(position, cid_array)
    local tile = Tile(position)
    local item = tile and tile:getItemById(config.pulled_id)
    if not item then
        return
    end

    local monster_names = {}
    for key, value in pairs(monsters) do
        if not isInArray(monster_names, value.name) then
            monster_names[#monster_names + 1] = value.name
        end
    end

    for i = 1, #monsters do
        local creatures = Tile(monsters[i].pos):getCreatures()
        for key, creature in pairs(creatures) do
            if isInArray(monster_names, creature:getName()) then
                creature:remove()
            end
        end
    end

    item:transform(config.lever_id)
end

Using
 
From looking at the code, the only thing that I can see is, it may be stopping at
Lua:
if not item then
try to debug the code.
print(item) under if not item to see if it goes thru.
 
Back
Top