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

[TFS 1.x] - SSA Exhaustion

Red

Cyntara.org
Staff member
Global Moderator
Premium User
Joined
Aug 9, 2008
Messages
4,455
Solutions
2
Reaction score
921
Location
United States
Since SSA equip exhaustion seems to be a popular request, I've decided to share a small code I wrote. This is to be placed in /events/scripts/player.lua

amuletId = Amulet item ID
storage = Storage value to store last placement
delay = Delay (in seconds) to how fast players should have to wait to place the amulet again.

Code:
local amuletId = 2197
local storage = 1000
local delay = 0.5 -- seconds

function Player:onMoveItem(item, count, fromPosition, toPosition)
    if item:getId() == amuletId then
        if toPosition.y == CONST_SLOT_NECKLACE then
            if os.time() > self:getStorageValue(storage) then
                self:setStorageValue(storage, os.time() + delay)
            else
                self:sendCancelMessage("Sorry, not possible.")
                return false
            end
        end
    end
    return true
end

Enjoy,
Red
 
Back
Top