• 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 onStatsChange "attacker" problems

Rayeko

Programmer
Joined
Apr 9, 2008
Messages
185
Reaction score
3
Hi.

I wonder if someone could tell me how to make the "attacker" to work with monsters in this function:
Code:
onStatsChange(cid, attacker, type, combat, value)
I alredy make it for players, but I can't get it to work with monsters..
This is the code I use with players:
Code:
getCreatureByName(getPlayerNameByGUID(getPlayerGUID(attacker)))
I think it can be smaller and easy.. xDD

I want this to make it work with "doCreatureAddHealth()" function xD

Thanks in advance!
 
Code:
doCreatureAddHealth(attacker, math.abs(value))
This would work as some kind of life drain.

Keep in mind that onStatsChange is not executed when a monster attacks a player - you would need to register it in its .XML file.
 
Thaaanks -again-! You saved me xDDD

Just to know.. How can I add something like that in the monster's XML ?
 
Back
Top