• 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 0.X Anihilator Problem

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Hi guys,

I have this script of anihilator, but got a problem: when player click on chest, chest turn into a lever, and player can get item above stone. Can u guys help me to fix this?

1632329330774.png


Lua:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 9006 then
        local count = 0
        local config = {
            questLevel = 100,
            playerPositions = {
                {start = {x=191, y=118, z=9}, destination = {x=191, y=118, z=10}},
                {start = {x=192, y=118, z=9}, destination = {x=192, y=118, z=10}},
                {start = {x=193, y=118, z=9}, destination = {x=193, y=118, z=10}},
                {start = {x=194, y=118, z=9}, destination = {x=194, y=118, z=10}}
            },
            spawnMonsters = {
                {position = {x=195, y=118, z=10}, monster = "Demon"},
                {position = {x=196, y=118, z=10}, monster = "Demon"},
                {position = {x=194, y=120, z=10}, monster = "Demon"},
                {position = {x=192, y=120, z=10}, monster = "Demon"},
                {position = {x=189, y=118, z=10}, monster = "Demon"},
                {position = {x=191, y=116, z=10}, monster = "Demon"},
                {position = {x=193, y=116, z=10}, monster = "Demon"}
            }
        }
        local players = {}
        for i = 1, #config.playerPositions do
            local pid = getTopCreature(config.playerPositions[i].start)
            if pid.uid > 0 then
                if isPlayer(pid.uid) then
                    if getPlayerLevel(pid.uid) >= config.questLevel then
                        table.insert(players, pid.uid)
                    end
                end
            end
        end
        if #players == #config.playerPositions then
            for i = 1, #players do
                doTeleportThing(players[i], config.playerPositions[i].destination)
                doSendMagicEffect(config.playerPositions[i].destination, CONST_ME_TELEPORT)
            end
            for v = 1, #config.spawnMonsters do
                doSummonCreature(config.spawnMonsters[v].monster, config.spawnMonsters[v].position)
                doSendMagicEffect(config.spawnMonsters[v].position, CONST_ME_TELEPORT)
            end
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    elseif item.uid == 9007 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
            doPlayerAddItem(cid,2494,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9008 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
            doPlayerAddItem(cid,2400,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9009 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
            doPlayerAddItem(cid,2431,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9010 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found thunder hammer.")
            doPlayerAddItem(cid,2421,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    end
    return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end

I got an error when player click 2x on "chest" too:

1632329724370.png

Follow file:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getBooleanFromString(getConfigValue('enableProtectionQuestForGM'))) then
        if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
            return true
        end
    end

    if item.uid > 1000 and item.uid < 11395 then
        local itemWeight = getItemWeightById(item.uid, 1)
        local playerCap = getPlayerFreeCap(cid)
        if getPlayerStorageValue(cid, item.uid) == -1 then
            if playerCap >= itemWeight then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
                doPlayerAddItem(cid, item.uid , 1)
                setPlayerStorageValue(cid, item.uid, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
        end
    else
        return false
    end

    return true
end
 
Last edited:
Solution
Hi guys,

I have this script of anihilator, but got a problem: when player click on chest, chest turn into a lever, and player can get item above stone. Can u guys help me to fix this?

View attachment 62271


Lua:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 9006 then
        local count = 0
        local config = {
            questLevel = 100,
            playerPositions = {
                {start = {x=191, y=118, z=9}, destination = {x=191, y=118, z=10}},
                {start = {x=192, y=118, z=9}, destination = {x=192, y=118, z=10}},
                {start = {x=193, y=118, z=9}, destination = {x=193, y=118, z=10}},
                {start = {x=194, y=118, z=9}, destination = {x=194, y=118, z=10}}
            }...
Hi guys,

I have this script of anihilator, but got a problem: when player click on chest, chest turn into a lever, and player can get item above stone. Can u guys help me to fix this?

View attachment 62271


Lua:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 9006 then
        local count = 0
        local config = {
            questLevel = 100,
            playerPositions = {
                {start = {x=191, y=118, z=9}, destination = {x=191, y=118, z=10}},
                {start = {x=192, y=118, z=9}, destination = {x=192, y=118, z=10}},
                {start = {x=193, y=118, z=9}, destination = {x=193, y=118, z=10}},
                {start = {x=194, y=118, z=9}, destination = {x=194, y=118, z=10}}
            },
            spawnMonsters = {
                {position = {x=195, y=118, z=10}, monster = "Demon"},
                {position = {x=196, y=118, z=10}, monster = "Demon"},
                {position = {x=194, y=120, z=10}, monster = "Demon"},
                {position = {x=192, y=120, z=10}, monster = "Demon"},
                {position = {x=189, y=118, z=10}, monster = "Demon"},
                {position = {x=191, y=116, z=10}, monster = "Demon"},
                {position = {x=193, y=116, z=10}, monster = "Demon"}
            }
        }
        local players = {}
        for i = 1, #config.playerPositions do
            local pid = getTopCreature(config.playerPositions[i].start)
            if pid.uid > 0 then
                if isPlayer(pid.uid) then
                    if getPlayerLevel(pid.uid) >= config.questLevel then
                        table.insert(players, pid.uid)
                    end
                end
            end
        end
        if #players == #config.playerPositions then
            for i = 1, #players do
                doTeleportThing(players[i], config.playerPositions[i].destination)
                doSendMagicEffect(config.playerPositions[i].destination, CONST_ME_TELEPORT)
            end
            for v = 1, #config.spawnMonsters do
                doSummonCreature(config.spawnMonsters[v].monster, config.spawnMonsters[v].position)
                doSendMagicEffect(config.spawnMonsters[v].position, CONST_ME_TELEPORT)
            end
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    elseif item.uid == 9007 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
            doPlayerAddItem(cid,2494,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9008 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
            doPlayerAddItem(cid,2400,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9009 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
            doPlayerAddItem(cid,2431,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9010 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found thunder hammer.")
            doPlayerAddItem(cid,2421,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    end
    return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) and true
end

I got an error when player click 2x on "chest" too:

View attachment 62272

Follow file:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getBooleanFromString(getConfigValue('enableProtectionQuestForGM'))) then
        if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
            return true
        end
    end

    if item.uid > 1000 and item.uid < 11395 then
        local itemWeight = getItemWeightById(item.uid, 1)
        local playerCap = getPlayerFreeCap(cid)
        if getPlayerStorageValue(cid, item.uid) == -1 then
            if playerCap >= itemWeight then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
                doPlayerAddItem(cid, item.uid , 1)
                setPlayerStorageValue(cid, item.uid, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
        end
    else
        return false
    end

    return true
end
Lua:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == 9006 then
        local count = 0
        local config = {
            questLevel = 100,
            playerPositions = {
                {start = {x=191, y=118, z=9}, destination = {x=191, y=118, z=10}},
                {start = {x=192, y=118, z=9}, destination = {x=192, y=118, z=10}},
                {start = {x=193, y=118, z=9}, destination = {x=193, y=118, z=10}},
                {start = {x=194, y=118, z=9}, destination = {x=194, y=118, z=10}}
            },
            spawnMonsters = {
                {position = {x=195, y=118, z=10}, monster = "Demon"},
                {position = {x=196, y=118, z=10}, monster = "Demon"},
                {position = {x=194, y=120, z=10}, monster = "Demon"},
                {position = {x=192, y=120, z=10}, monster = "Demon"},
                {position = {x=189, y=118, z=10}, monster = "Demon"},
                {position = {x=191, y=116, z=10}, monster = "Demon"},
                {position = {x=193, y=116, z=10}, monster = "Demon"}
            }
        }
        local players = {}
        for i = 1, #config.playerPositions do
            local pid = getTopCreature(config.playerPositions[i].start)
            if pid.uid > 0 then
                if isPlayer(pid.uid) then
                    if getPlayerLevel(pid.uid) >= config.questLevel then
                        table.insert(players, pid.uid)
                    end
                end
            end
        end
        if #players == #config.playerPositions then
            for i = 1, #players do
                doTeleportThing(players[i], config.playerPositions[i].destination)
                doSendMagicEffect(config.playerPositions[i].destination, CONST_ME_TELEPORT)
            end
            for v = 1, #config.spawnMonsters do
                doSummonCreature(config.spawnMonsters[v].monster, config.spawnMonsters[v].position)
                doSendMagicEffect(config.spawnMonsters[v].position, CONST_ME_TELEPORT)
            end
        else
            doPlayerSendCancel(cid, "Sorry, not possible.")
        end
    elseif item.uid == 9007 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
            doPlayerAddItem(cid,2494,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9008 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
            doPlayerAddItem(cid,2400,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9009 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
            doPlayerAddItem(cid,2431,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    elseif item.uid == 9010 then
        queststatus = getPlayerStorageValue(cid,5000)
        if queststatus == -1 then
            doPlayerSendTextMessage(cid,22,"You have found thunder hammer.")
            doPlayerAddItem(cid,2421,1)
            setPlayerStorageValue(cid,5000,1)
        else
            doPlayerSendTextMessage(cid,22,"It is empty.")
        end
    end
    local itemId = item.itemid
    if itemId == 1945 or itemId == 1946 then
        doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    end
    return true
end
 
Solution
Back
Top