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

TFS 0.X Dodge System - not working

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,403
Solutions
17
Reaction score
151
Location
Brazil
Im using this Dodge System


But im taking hit from monsters when "Dodge" message apppears, i put to print result on console and the result is the hit im taking:

1633345240141.png

Lua:
local lvldodge = 48902
local percent = 1


function onStatsChange(cid, attacker, type, combat, value)
    if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then
        if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
            value = math.ceil(value*(percent))
            print("value: "..value)
            doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
            doSendAnimatedText(getCreaturePos(cid), "DODGE", 6)
        return false
        end
    end
return true
end

Can u guys help me to fix and dodge do not take any damage?
 
Solution
Im using this Dodge System


But im taking hit from monsters when "Dodge" message apppears, i put to print result on console and the result is the hit im taking:

View attachment 62543

Lua:
local lvldodge = 48902
local percent = 1


function onStatsChange(cid, attacker, type, combat, value)
    if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then
        if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
            value = math.ceil(value*(percent))
            print("value: "..value)
            doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
            doSendAnimatedText(getCreaturePos(cid), "DODGE", 6)
        return false...
Im using this Dodge System


But im taking hit from monsters when "Dodge" message apppears, i put to print result on console and the result is the hit im taking:

View attachment 62543

Lua:
local lvldodge = 48902
local percent = 1


function onStatsChange(cid, attacker, type, combat, value)
    if type == STATSCHANGE_HEALTHLOSS and isCreature(attacker) then
        if (getPlayerStorageValue(cid, lvldodge)*3) >= math.random (0,1000) then
            value = math.ceil(value*(percent))
            print("value: "..value)
            doTargetCombatHealth(attacker, cid, combat, -value, -value, 255)
            doSendAnimatedText(getCreaturePos(cid), "DODGE", 6)
        return false
        end
    end
return true
end

Can u guys help me to fix and dodge do not take any damage?
Change second line to:
local percent = 0
 
Solution
Change second line to:
local percent = 0
Nice catch, thank you!
Post automatically merged:

@Peonso could you help me in one more thing?

I want to restrict the use of the item to the player who has storage 176602 with value greater than 75.
 
Last edited:
Back
Top