Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to breath heavily
Mooserider Offline
Member

Posts: 64
Threads: 11
Joined: Jan 2011
Reputation: 2
#2
RE: How to breath heavily

Try this script out:

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""ScriptArea_2""PlayerInBreathArea"false0);
}
void PlayerInBreathArea(string &in asParentstring &in asChildint alState)
{
    if (
alState == 1)
    {
        
PlaySoundAtEntity("""react_breath_slow.snt""Player"0.0ffalse);
        
AddTimer("BreathTimer"2.0f"BreathTimer");
    }

    else
    {
        
RemoveTimer("BreathTimer");
    }
}

void BreathTimer(string &in asTimer)
{
    
AddTimer("BreathTimer"2.0f"BreathTimer");
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0.0ffalse);


Alternatively if you want to stay breathing even after you've left the area simply remove the lines:

PHP Code: (Select All)
    else
    {
        
RemoveTimer("BreathTimer");
    } 
You can also change the .snt file if you want a different breath sound effect Smile

Working on a FC: "Don't Let Go "
(This post was last modified: 06-24-2012, 06:30 AM by Mooserider.)
06-24-2012, 06:28 AM
Find


Messages In This Thread
How to breath heavily - by Jagsrs28 - 06-24-2012, 05:39 AM
RE: How to breath heavily - by Mooserider - 06-24-2012, 06:28 AM
RE: How to breath heavily - by Jagsrs28 - 06-24-2012, 06:43 AM
RE: How to breath heavily - by Mooserider - 06-24-2012, 06:48 AM
RE: How to breath heavily - by Jagsrs28 - 06-24-2012, 06:53 AM
RE: How to breath heavily - by Mooserider - 06-24-2012, 07:13 AM
RE: How to breath heavily - by Jagsrs28 - 06-24-2012, 07:18 AM
RE: How to breath heavily - by Mooserider - 06-24-2012, 09:30 AM



Users browsing this thread: 1 Guest(s)