Author Topic: Adding sound to a playertype?  (Read 520 times)

ive been making playertypes and im having trouble adding sounds but.....when i put the sounds in and add the script they dont work....anyone know the corect script to add Player (death, hurt, Jump) sounds into my playertype?

I don't really have to much info on how to do this. But i copied this from Zombies - Witch.

function RotWitchZombie::SpecialAttack(%this,%onshot)
{
   if(isobject(%this) && %this.lastspecial+5000 < getsimtime())
   {
      %this.playaudio(2,"WitchAttack" @ getrandom(1,2) @ "Sound");
      %this.lastspecial = getsimtime();
   }
}

You should try somthing like

function YOURPLAYERNAME::Jump(%this,%onshot)
{
   if(isobject(%this) && %this.lastspecial+5000 < getsimtime())
   {
      %this.playaudio(2,"WitchAttack" @ getrandom(1,2) @ "Sound");
      %this.lastspecial = getsimtime();
   }
}

I don't really know. Anyway, Good luck!