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

Lua Error in StatsChange

lhc00

New Member
Joined
Mar 23, 2010
Messages
23
Reaction score
0
I would like to know how do I make a creature lose HP when it takes damage, I've tried something with onStatsChange but it didn't works :(.

Code:
function onStatsChange(cid, attacker, type, combat, value)
         if type == STATSCHANGE_HEALTHLOSS then
            doCreatureAddHealth(cid, -50) 
            return FALSE
         end
         return TRUE
end

in addition the client send this error every time i attack the creature :blink:
erroam.jpg


I use the TFS 0.3.6, any ideas will be welcome :)

Thx guys ^_^
 
Last edited:
Lua:
function onStatsChange(cid, attacker, type, combat, value)
         if type == STATSCHANGE_HEALTHLOSS and combat ~= COMBAT_DROWNDAMAGE then
            doCreatureAddHealth(cid, -50) 
			doTargetCombatHealth(0, cid, COMBAT_DROWNDAMAGE, -50, -50, 12)
            return false
         end
         return true
end
 
Last edited:
LoL I can't believe it was just that, thx again ^_^

Edit: How do I make the function doTargetCombatHealth do not send any magic effect?
 
Last edited:
doTargetCombatHealth(0, cid, COMBAT_DROWNDAMAGE, -50, -50, CONST_ME_NONE)
 
Back
Top