insebbe123
New Member
- Joined
- Mar 31, 2012
- Messages
- 44
- Reaction score
- 2
hello, i got a major problem, tried to make a blocking system that makes u have a 5-10% chance to 100% block a physical damage and it only works for knights it works but the thing is that i can't use healing runes or spells, i doesn't grant any healing but if i heal the block shows, im really bad at scripting sorry
Lua:
function onStatsChange(cid, attacker, type, combat, value)
local chance = 25
if isKnight(cid) == true then
else
end
if isPlayer(cid) or isCreature(attacker) then -- in case you register monsters later
if type == STATSCHANGE_HEALTHLOSS and value > 10000 then
if combat == COMBAT_PHYSICALDAMAGE then --add the upper condition here if you want them
end
end
end
if math.random(100) <= chance then
doSendAnimatedText(getPlayerPosition(cid),"BLOCK!", TEXTCOLOR_GREY)
return false
end
end