Brasilingos
New Member
- Joined
- Oct 25, 2020
- Messages
- 13
- Reaction score
- 1
Hi guys i created a damage boost potion but after player uses potion they dont have dmg boost. Can someone help me and find where is the solution?
TFS 1.3
TFS 1.3
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
if origin == ORIGIN_MELEE then
creature:say("SKULLBASH!", TALKTYPE_MONSTER_SAY)
elseif origin == ORIGIN_RANGED then
creature:say("HEADSHOT!", TALKTYPE_MONSTER_SAY)
end
return primaryDamage * 1000, primaryType, secondaryDamage, secondaryType
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
DMGboostpotion:id(12544)
DMGboostpotion:register()
DMGboostpotions:register()