What is wrong in this?
I can't seem to get it working like i want.
function HCZZombie::onDamage(%this,%obj,%delta)
{
Parent::onDamage(%this,%obj,%delta);
if(isobject(%obj) && isobject(%obj.minigame))
{
if((%HCZpainsoundran) == 1)
{
%obj.playaudio(1,"HCZpain1Sound");
}
else if((%HCZpainsoundran) == 2)
{
%obj.playaudio(1,"HCZpain2Sound");
}
}
}
I created %HCZpainsoundran somewhere else ("%HCZpainsoundran = getrandom(1,2);"), and when i run the add-on, the console reports nothing odd...
I have an alternative way though, but i'd like to know what i did wrong...
It MAY be something else, but i know almost sure there is something with this, what is wrong...
So, yeah...