Frictional Games Forum (read-only)

Full Version: How can I play a sound when the player dies?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically, when the player dies I want there to be a sound playing... How could I do this?
I'm not really sure, I will test this out myself later tonight. But looking at the Frictional Wiki. You could
probally use this
Code:
float GetPlayerHealth();
with conjunction of a timer that fires every 1 second.
So make a If statement that if the player's health drops below 10 (I think that's the lowest health you could possibly go to if you fall from heights) You would play the sound.

CheckPoint (string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

asCallback - the function to call when the player dies/respawns

Just put the sound inside the callback. I'm not sure but the sound should play right after death, just test if it works like you want...