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

Muck Remover TFS 1.0

raf

Active Member
Joined
Jan 10, 2011
Messages
266
Reaction score
42
Location
Warsaw, PL
Hi, i've already tried to do this with remaking rust remover script, but when i use muck remover on mucus plug (and mucus plug is 2+ in stack), it uses all mucus plugs in stack.

PHP:
local nTable = {
    [18396] = {
        {"crystal backpack", 16.41},
        {"blue gem", 15.52},
        {"glowing mushroom", 15.34},
        {"violet crystal shard", 14.98},
        {"blue crystal splinter", 14.53},
        {"blue crystal shard", 14.08},
        {"crystal mace", 4.93},
        {"crystalline armor", 2.96},
        {"crystalline sword", 1.26}
    }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if nTable[itemEx.itemid] then
        -- if 50 < math.random(100) then
        --     doRemoveItem(cid, itemEx.uid,1)
        -- else
            local nID = nTable[itemEx.itemid]
           

            local random, chance = math.random() * 100, 0

            for i = 1, #nTable do
                chance = chance + nTable[i][2]
                if random <= chance then
                    if nID == 18414 then
                        doRemoveItem(cid, itemEx.uid,1)
                        nID:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
                        doPlayerAddItem(cid,nID, 10)
                    else
                        doRemoveItem(cid, itemEx.uid,1)
                        doPlayerAddItem(cid, nID, 1)
                    end
                end
            end
        -- end
    end
end
 
Back
Top