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

I need a script (counter damage dealt and received)

Lakkir

Active Member
Joined
Jan 6, 2009
Messages
29
Reaction score
25
Location
Chile
I need a script that makes a storage value counter of damage dealt and received
I have experience working with lua so, I wont have problem editing the script.
Thanks

- - - Updated - - -

I do it, if anyone wants it:

function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) then
if isInArray({COMBAT_ENERGYDAMAGE, COMBAT_FIREDAMAGE, COMBAT_PHYSICALDAMAGE, COMBAT_EARTHDAMAGE, COMBAT_POISONDAMAGE, COMBAT_UNDEFINEDDAMAGE, COMBAT_LIFEDRAIN, COMBAT_MANADRAIN, COMBAT_DROWNDAMAGE, COMBAT_ICEDAMAGE, COMBAT_HOLYDAMAGE, COMBAT_DEATHDAMAGE}, combat) then
if type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS then
total = getPlayerStorageValue(cid,44451)
setPlayerStorageValue(cid,44451,total+value)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Total de daño recibido: " .. total+value .. "")
totala = getPlayerStorageValue(attacker,44452)
setPlayerStorageValue(attacker,44452,totala+value)
doPlayerSendTextMessage(attacker, MESSAGE_EVENT_DEFAULT, "Total de daño hecho: " .. totala+value .. "")
end
end
end

return true
end
 
Last edited:
Back
Top