• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Annihilator bug. tfs 1.2

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello! I have this annihilator script - i don't know why the script not working, when I try to use the lever the console show this lines: (acti0n interface) on use attempt to index a nil value/ lua33 in function/ lua 28

code:
Code:
local config = {
    requiredLevel = 1,
    daily = false,
    centerDemonRoomPosition = Position(1017, 1205, 4),
    playerPositions = {
        Position(959, 1042, 11),
        Position(959, 1043, 11),
        Position(959, 1244, 11),
        Position(959, 1045, 11)
    },
    newPositions = {
        Position(1036, 1205, 4),
        Position(1037, 1205, 4),
        Position(1038, 1205, 4),
        Position(1039, 1205, 4)
    },
    demonPositions = {
        Position(1037, 1203, 4),
        Position(1039, 1203, 4),
        Position(1036, 1207, 4),
        Position(1038, 1207, 4),
        Position(1040, 1205, 4),
        Position(1041, 1205, 4)
    }
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1946 then
        local storePlayers, playerTile = {}

        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not playerTile or not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 4 players.")
                return true
            end

            if playerTile:getLevel() < config.requiredLevel then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
                return true
            end

            storePlayers[#storePlayers + 1] = playerTile
        end

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 3, 3, 2, 2)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.")
                return true
            end

            spec:remove()
        end

        for i = 1, #config.demonPositions do
            Game.createMonster("Orshabaal", config.demonPositions[i])
        end

        local players
        for i = 1, #storePlayers do
            players = storePlayers[i]
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
        end
    elseif item.itemid == 1945 then
        if config.daily then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return true
        end
    end

    item:transform(item.itemid == 1946 and 1945 or 1946)
    return true
end
 
between line 32/33 add
Code:
print_r(config.playerPositions[i])
and if that prints correct values chance it to
Code:
print_r(Tile(config.playerPositions[i]):getTopCreature())
if you dont have print_r you can get it here https://gist.github.com/nrk/31175 (put it in global.lua or something)
 
between line 32/33 add
Code:
print_r(config.playerPositions[i])
and if that prints correct values chance it to
Code:
print_r(Tile(config.playerPositions[i]):getTopCreature())
if you dont have print_r you can get it here https://gist.github.com/nrk/31175 (put it in global.lua or something)

error: (acti0n interface) on use attempt to index a nil value/ lua34 in function/ lua 28

y1042
x959
z11
stackpos - 0

y1043
x959
z11
stackpos - 0

y1044
x959
z11
stackpos - 0

its look like the 4 position did not work correctly?

+ when I use this:
Code:
print_r(Tile(config.playerPositions[i]):getTopCreature())
its show error in lines 33/28 and userdatas
 
Back
Top