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

Lua Rusty remove does not disapear

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
43
These just dont disappear when i use them on a rusty item. The stack stays 100.

Secondary problem: shield,boots and helmet do not work..
Code:
13:34 You see 100 flask of rust removers.
They weigh 90.00 oz.
It can be used to clean and polish old and rusty armors.
ItemID: [9930].

Code:
-------------------------------------------------
-------------------CONFIGURE-----------------------
-------------------------------------------------

    local config = {
            rustyarmorid = 9808,
            rustylegsid = 9811,
            rustyshieldsid = 9814,
            rustybootsid = 9817,
            rustyhelmetsid = 9820,
            rustyremoveid = 9930
            }
---------------------CHANCES------------------------
    local prizes = {
            armors = {
                {70,2472},-- mpa
                {100,2466},-- golden armor
                {100,2487},-- crown armor
                {100,8891}, --paladin armor
                {500,2463}, --plate armor
                {800,2465}, --brass
                {850,2464}, --chain arm
                {900,2483} --studded armor


                },

            legs ={
                {100,2470},--golden legs
                {100,2488},--crownlegs
                {400,2477},--knight legs
                {600,2647},--plate legs
                {750,2478},--brass legs
                {800,2648},--chainlegs
                {900,2468}--studded legs

                },
               
            shields ={
                {100,2520},--demonshield
                {400,2519},--crownshield
                {300,2534},--vampireshield
                {650,2510},--plateshield
                {700,2526},--studdedshield
                {800,2512}--woodenshield

                },
               
            boots ={
                {90,2195},--boots of haste
                {10,2519},--boots of waterwalking
                {300,2645},--steelboots
                {650,2643},--leatherboots
                {500,2644},--bunnyslippers
                {10,2646}--goldenboots

                },
               
            helmets ={
                {400,3969},--horseman helmet
                {300,3972},--bonelord helmet
                {80,5461},--Helmet of the Deep
                {200,5741},--Skull helmet
                {500,2491},--crown helmet
                {10,2471},--goldenhelmet
                {450,2475}--warriorhelm

                }
            }
----------------------------------------------------------
                       
function onUse(cid, item, fromPosition, itemEx, toPosition)

    if item.itemid == config.rustyremoveid then
        if itemEx.itemid == config.rustyarmorid then
                local prize1 = {}
                local reward1 = 0
            for i = 1, #prizes.armors do
                prize1 = prizes.armors[i]
                rand = math.random(0,999)
                if  rand < prize1[1] then
                                reward1 = prize1[2]
                    doTransformItem(itemEx.uid, reward1)
                    doSendMagicEffect(toPosition,CONST_ME_BLOCKHIT)
                break
                elseif rand > 900 then
                    doRemoveItem(itemEx.uid)
                    doSendMagicEffect(toPosition,CONST_ME_POFF)
                   
                break
                end
            end

        elseif itemEx.itemid == config.rustylegsid then
                local prize = {}
                local reward = 0
            for i = 1, #prizes.legs do
                prize = prizes.legs[i]
                rand = math.random(0,999)
                if rand < prize[1] then
                                reward = prize[2]
                    doTransformItem(itemEx.uid, reward)
                    doSendMagicEffect(toPosition,CONST_ME_BLOCKHIT)
                break
                elseif rand > 900 then
                    doRemoveItem(itemEx.uid)
                    doSendMagicEffect(toPosition,CONST_ME_POFF)
                break

               
                end
            end

        else
            return FALSE
       
        end

       
    end
return TRUE
end
 
Back
Top