• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ Ring Exhastion

Joriku

Working in the mines, need something?
Joined
Jul 16, 2016
Messages
1,175
Solutions
17
Reaction score
481
Location
Sweden
Hello,
I'm having an issue with finding out how I change the cooldown of using rings, ssa etc.
I've been looking on some posts on Otland but cannot find any help from them.
I've checked thru source files afther
OnEquip
etc. etc.
 
player events is the best thing of 1.x

 
player events is the best thing of 1.x

Didn't work, checked by spamming with mouse and the cooldown works without any issues. But while pressing on hotkey it's a 2 second delay.
Any ideas?
 
LUA:
local exhausted_accessories = {
    [2197] = {ms = 500, storage = 88162}
}

function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
    local accessory = exhausted_accessories[item:getId()]
    if accessory then
        local endTime = self:getStorageValue(accessory.storage)
        if endTime >= os.mtime() then
            return false
        end
        self:setStorageValue(accessory.storage, os.mtime() + accessory.ms)
    end
    -- rest of the code inside of onMoveItem
    return true
end
Don't forget to make sure there's only ONE Player:onMoveItem, you have to move the core code of this into your existing one and set enabled="1" in events.xml.
 
LUA:
local exhausted_accessories = {
    [2197] = {ms = 500, storage = 88162}
}

function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
    local accessory = exhausted_accessories[item:getId()]
    if accessory then
        local endTime = self:getStorageValue(accessory.storage)
        if endTime >= os.mtime() then
            return false
        end
        self:setStorageValue(accessory.storage, os.mtime() + accessory.ms)
    end
    -- rest of the code inside of onMoveItem
    return true
end
Don't forget to make sure there's only ONE Player:onMoveItem, you have to move the core code of this into your existing one and set enabled="1" in events.xml.
Tried to change the code. But cannot get it to work faster.
It went slower. "You can't look very fast"
3e1297774944976553213c2f6313915d.png

Here's the whole player.lua file. Can't solve this. Help me understand this.
 

Attachments

Back
Top