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

Exausted onEquip SSA

willdu

Active Member
Joined
Mar 11, 2017
Messages
91
Reaction score
25
Is anyone have or know how to do a effective exhausted to equip SSA on 0.4?
I saw a lot of topics asking for it here, but no solutions...
 
Solution
Give this a try.

Lua:
local exhaustTime = 3 -- How many seconds of exhaust between equipping

function onEquip(cid, item, slot)
    if item.uid ~= 0 then
   
        if tonumber(getItemAttribute(item.uid, "equipped")) and tonumber(getItemAttribute(item.uid, "equipped")) == 1 then
            return true
        end

        if getCreatureStorage(cid, "ssaexhaust") < os.time() then
            callFunction(cid, item.uid, slot, false)
            doCreatureSetStorage(cid, "ssaexhaust", os.time() + exhaustTime)
            doItemSetAttribute(item.uid, "equipped", 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not equip an ssa for " .. getCreatureStorage(cid, "ssaexhaust") - os.time() .. "...
Give this a try.

Lua:
local exhaustTime = 3 -- How many seconds of exhaust between equipping

function onEquip(cid, item, slot)
    if item.uid ~= 0 then
   
        if tonumber(getItemAttribute(item.uid, "equipped")) and tonumber(getItemAttribute(item.uid, "equipped")) == 1 then
            return true
        end

        if getCreatureStorage(cid, "ssaexhaust") < os.time() then
            callFunction(cid, item.uid, slot, false)
            doCreatureSetStorage(cid, "ssaexhaust", os.time() + exhaustTime)
            doItemSetAttribute(item.uid, "equipped", 1)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not equip an ssa for " .. getCreatureStorage(cid, "ssaexhaust") - os.time() .. " seconds.")
            return false
        end
    end
    return true
end

function onDeEquip(cid, item, slot)
    callFunction(cid, item.uid, slot, false)
    doItemSetAttribute(item.uid, "equipped", -1)
    return true
end
 
Last edited:
Solution
Give this a try.

Lua:
local exhaustTime = 3 -- How many seconds of exhaust between equipping

function onEquip(cid, item, slot)
    if getCreatureStorage(cid, "ssaexhaust") > os.time() then
        doPlayerSendCancel(cid, "You may not equip an ssa for " .. getCreatureStorage(cid, "ssaexhaust") - os.time() .. " seconds.")
        return false
    end
   
    if item.uid ~= 0 then
        callFunction(cid, item.uid, slot, false)
        doCreatureSetStorage(cid, "ssaexhaust", os.time() + exhaustTime)
    end
    return true
end

function onDeEquip(cid, item, slot)
    callFunction(cid, item.uid, slot, false)
    return true
end

Using this, when i try to equip a SSA in the neck slot, with no amulet there, shows
"There is not enough room."
 
Back
Top