The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Random sounds
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
Random sounds

I'm trying to get random sounds to play but I must be doing something wrong because they wont. Before trying this I didnt even know you could do random sounds, so I started by simply copying the script from the Prison map from the base game and changed the sound file and script area names to match, but nothing plays.

Here is what I have:

Quote: /*creaks
*/
void TimerCreaky(string &in asTimer)
{
PlaySoundAtEntity("Creaks", "afx_mansion_gallery_creak", "AreaCreaks_"+RandInt(1,8), 0.0, false);

AddTimer("TimerCreaky", RandInt(10, 20), "TimerCreaky");
}


//===========================================
// This runs when the map first starts
void OnStart()



{

AddTimer("TimerCreaky", RandInt(18, 40), "TimerCreaky");

}

In the map I have script areas named AreaCreaks_1, AreaCreaks_2, etc up to 8. What did I do wrong?

(This post was last modified: 05-20-2016, 09:29 AM by serbusfish.)
05-20-2016, 09:26 AM
Find


Messages In This Thread
Random sounds - by serbusfish - 05-20-2016, 09:26 AM
RE: Random sounds - by Mudbill - 05-20-2016, 09:44 AM
RE: Random sounds - by serbusfish - 05-20-2016, 10:04 AM
RE: Random sounds - by Mudbill - 05-21-2016, 12:38 AM
RE: Random sounds - by Daemian - 05-21-2016, 01:24 AM



Users browsing this thread: 1 Guest(s)