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

Damage Increase Potion tfs 1.3

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?
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()
 
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?
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()
up
 

onUse - to apply the affect
onHealthChange - to apply the damage
creature:registerEvent - to register the onHealthChange to the player.

Just missing that last step. :)
 

onUse - to apply the affect
onHealthChange - to apply the damage
creature:registerEvent - to register the onHealthChange to the player.

Just missing that last step. :)
thank you <3
 
Back
Top