Author Topic: How to play sound when you die?  (Read 1252 times)


Code: [Select]
function GameConnection::onDeath(%client)
{

    %client.play2d(AudioDatablock);
    Parent::onDeath(%client);

}

I think that's it.


Modify Player::playDeathCry.

Code: [Select]
function GameConnection::onDeath(%client)
{

    %client.play2d(AudioDatablock);
    Parent::onDeath(%client);

}

I think that's it.
Don't listen to this guy. This'll break a lot of things. It's gameConnection::onDeath(%client, %killerPlayer, %killer, %damageType, %area).

But you shouldn't do that anyways. Do what Port said.


What's this found in?

Its a function
ie
Code: [Select]
package blah
{
    function Player::playDeathCry(%this)
    {
         parent::playDeathCry(%this);

         //play sound here
    }
};

EDIT
if you are trying to CHANGE a player's death sound, remove the parent and play the sound in 3D. (if you arent already)
« Last Edit: April 15, 2014, 10:36:09 PM by Wrapperup »

Its a function
ie
Code: [Select]
package blah
{
    function Player::playDeathCry(%this)
    {
         parent::playDeathCry(%this);

         //play sound here
    }
};

EDIT
if you are trying to CHANGE a player's death sound, remove the parent and play the sound in 3D. (if you arent already)
Where do I put the death sound? never mind


Am I packaging this correctly? http://www.mediafire.com/download/zru8zmgdppkwlax/Server_Goodbye.zip
No. You always NEED a description.txt. Even if it's blank. Also, in the script you never create the sound datablock, you never play the sound, and you never activate the package.