Play random sounds

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Play random sounds

Postby Candle » Sat Sep 16, 2006 7:57 am

Put your sound files in the External folder and name them as you like but I found it easy to do it this way.
In the hotspot you want to play the random sound just add this :

Code: Select all
randomize
   i = int( RND * 4 ) + 1
   If i = 1 then PlaySound GetPath(2) + "voice1.mp3", False
   If i = 2 then PlaySound GetPath(2) + "voice2.mp3", False
   If i = 3 then PlaySound GetPath(2) + "voice3.mp3", False
   If i = 4 then PlaySound GetPath(2) + "voice4.mp3", False

It will play a random sound each time the hotspot is clicked. I'm using it on a payphone.
User avatar
Candle
Administrator
 
Posts: 3061
Joined: Sat Feb 07, 2004 2:21 am
Location: Rudy's Bar

Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron