• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Function OnStatsChange Problem

Sytoxian

New Member
Joined
Aug 19, 2010
Messages
40
Reaction score
1
Hey,
When I'm using this script, the player gains no damage and the script does not give the player mana!
Why does it now work?

Code:
function onStatsChange(cid, attacker, type, combat, value)
if type == STATSCHANGE_HEALTHLOSS then
if getPlayerStorageValue(cid, 849343) > 0 then
		doSendMagicEffect(getPlayerPosition(cid), 12)
		doCreatureAddMana(cid, (getCreatureMaxMana(cid) * 0.02))
	end
	elseif type == STATSCHANGE_HEALTHGAIN then
return false
end
return true
end

I edited it to

Code:
function onStatsChange(cid, attacker, type, combat, value)
if getPlayerStorageValue(cid, 849343) > 0 then
		doSendMagicEffect(getPlayerPosition(cid), 12)
		doCreatureAddMana(cid, (getCreatureMaxMana(cid) * 0.02))
	end
return true
end

in addition the client send this error every time i attack the creature ..
[01/12/2012 11:31:50] [Error - CreatureEvent::executeStatsChange] Call stack overflow.
 
Last edited:
Back
Top