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() .. "...
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
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."