Ascuas Funkeln
Rakkedo Game
- Joined
- Apr 14, 2013
- Messages
- 549
- Solutions
- 32
- Reaction score
- 305
- Location
- Poland
- GitHub
- AscuasFunkeln
Hello, this is my fix of this problem, its not super pro, but should be fine for use.
When i test this problem i noticed that in TFS "ranged weapons" when attack are used like an "action".
Before source edit, check if config.lua edit is enough (by Lessaire)
Change this:
To this:
Change this:
And compile
Then in config.lua set this values
Then setup potions and all items thats you wanna to have cooldown like this example
In "player:setStorageValue(55555, os.time() + 3)", number "+ 3" define cooldown in seconds.
Now distance attack and using potions or items should work fine.
OFC, make different storages for each item!
When i test this problem i noticed that in TFS "ranged weapons" when attack are used like an "action".
Before source edit, check if config.lua edit is enough (by Lessaire)
Change this:
Code:
integer[ACTIONS_DELAY_INTERVAL] = getGlobalNumber(L, "timeBetweenActions", 200);
integer[EX_ACTIONS_DELAY_INTERVAL] = getGlobalNumber(L, "timeBetweenExActions", 1000);
Change this:
Code:
integer[ACTIONS_DELAY_INTERVAL] = getGlobalNumber(L, "timeBetweenActions", 0);
integer[EX_ACTIONS_DELAY_INTERVAL] = getGlobalNumber(L, "timeBetweenExActions", 0);
Then in config.lua set this values
Code:
-- Item Usage
timeBetweenActions = 0
timeBetweenExActions = 0
Then setup potions and all items thats you wanna to have cooldown like this example
In "player:setStorageValue(55555, os.time() + 3)", number "+ 3" define cooldown in seconds.
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(55555) >= os.time() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
return true
end
local PotionValue = 500
if target:isPlayer() then
player:setStorageValue(55555, os.time() + 3)
item:remove(1)
target:addHealth(PotionValue)
target:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
return false
end
end
Now distance attack and using potions or items should work fine.
OFC, make different storages for each item!
Last edited: