Jump to content
Sign in to follow this  
Bravo33

Play sound based on DayTime

Recommended Posts

I've trolled the forum to no avail and hope some one can point me in the right direction.

I trying to get say church bells or calling to prayers to run a certain times of day based on triggers.

If DayTime1 =>10:00 then run sound for 10 minutes

or

If DayTime2 => 14:00 then run sound for 10 minutes

and so on

Any help greatly appreciated.

Share this post


Link to post
Share on other sites

th_armamazing.jpg

Just fill onActivation with anything you like that plays 10 minutes of whatever.

Share this post


Link to post
Share on other sites

if (daytime > 19 || daytime < 4) then {

playSound "calling.ogg";

};

That should get the sound to play, obviously you can change the time. I am not sure how to get it to keep playing for 10 minutes though. Maybe figure out how long it is, and do a sleep on the next line for how long the sound is then do another playSound until you add up to 10 minutes.

Share this post


Link to post
Share on other sites

Yep, only problem is that on activation would be any time of day rather than a specific time.

So if the trigger becomes active and say the time is 14:30 then the sound won't play.

Sorry but I'm a scriping "newbee" so any help appreciated.

Share this post


Link to post
Share on other sites

Still can't get the sound to activate based on time of day.

However , I've also got the problem that the sound does not diminish based on the distance from the source.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×