Brasilingos
New Member
- Joined
- Oct 25, 2020
- Messages
- 13
- Reaction score
- 1
Hello Guys,
I have script for dmg boost potion, but he is not working correctly.
After player use potion - there is nothing changes he is not attacking more. Can someone help me?
I have script for dmg boost potion, but he is not working correctly.
After player use potion - there is nothing changes he is not attacking more. Can someone help me?
Lua:
local DMGboostpotion = Action()
local DMGboostpotions = CreatureEvent("DMGboostpotions")
function DMGboostpotion.onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getStorageValue(18060) >= os.time() then
player:say('You already have +10% dmg deals!', TALKTYPE_MONSTER_SAY)
return true
end
player:setStorageValue(18060, os.time() + 86400)
Item(item.uid):remove(1)
player:say('Your 24 hours of +10% dmg deals has started!', TALKTYPE_MONSTER_SAY)
return true
end
function DMGboostpotions.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if attacker:getStorageValue(18060) >= os.time() then
return primaryDamage * 1000, primaryType, secondaryDamage, secondaryType
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
DMGboostpotion:id(12544)
DMGboostpotion:register()
DMGboostpotions:register()