Random Level Up Theme Addon

90 Draenei Paladin
8040
Hey, folks. I'm thinking about writing up an add-on that plays one of three level up tunes at a time. Making an addon to play just one sound file is pretty easy. My question is... what do I have to do to make it play one of those three files?
Reply Quote
90 Dwarf Mage
10875
You'll want to put the paths to the three files in an array-style table then use the math.random function to choose a random one. Use PlaySoundFile to play the sound.

If you want an example of this, I've just made the gist below. If you'd rather figure it out yourself, you can simply ignore the gist.

https://gist.github.com/4204952
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]