Posts
5
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!///////////////////////////////////////////////////////////////////////////////////////////////////////////
//Can use trigger damage or radius.// will need edited for trigger use
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//thread rand_sound();//put with thread calls//level.IsPlaying = false;//put with thread calls default is false
//use level.IsPlaying in any other audio eggs as a flag to prevent songs from overlapping and check with an
// if statement before allowing playback
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//this function can be used for music tracks, sound fx, voice overs, or whatever other kinds of sound you
//want to play
////////////////////////////////////////////////////////////////////////////////////////////////////////
rand_sound()
{
trig = getent("play_rand_song" , "targetname");
songs[songs.size] = "";//alias name in ""
songs[songs.size] = "";
songs[songs.size] = "";
songs[songs.size] = "";
songs[songs.size] = "";
song = undefined;
time = undefined;
players = getplayers();
for(;;)
{
trig waittill("trigger");
if(level.IsPlaying == false)
{
for(i = 0; i < songs.size; i++)
{
songs = array_randomize(songs);
song = songs[i];
if(song == "") time = ;// add in the alias name and set the time to be = to the length of the song in seconds for each song
if(song == "") time = ;
if(song == "") time = ;
if(song == "") time = ;
if(song == "") time = ;
}
for(x = 0; x < players.size; x++)
{
players[x] playsound(song);
}
level.IsPlaying = true;
wait(time);
level.IsPlaying = false;
}
}
//thread rand_sound(); // uncomment this to reuse
}