• 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 Equip item only if you have certain storage?

FilipeJF

New Member
Joined
Jan 9, 2012
Messages
124
Reaction score
4
Is there a possibility to equip an item only if you have a certain storage? Like, I wish to make a colar that regenerates mana only if you got a certain storage. How can I declare that in the item script?

TFS 036 CryingDanmson
 
Solution
Code:
function onEquip(cid, item, slot, boolean)
    if getPlayerStorageValue(cid, 5000) ~= 1 then
        doPlayerSendCancel(cid, "Sorry not possible.")
        return false
    end

    return true
end
Code:
function onEquip(cid, item, slot, boolean)
    if getPlayerStorageValue(cid, 5000) ~= 1 then
        doPlayerSendCancel(cid, "Sorry not possible.")
        return false
    end

    return true
end
 
Solution
Code:
function onEquip(cid, item, slot, boolean)
    if getPlayerStorageValue(cid, 5000) == 1 then
        return true
    end
doPlayerSendCancel(cid, "Sorry not possible.")
    return false
end
 
Back
Top