generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: I need help playing a random track audio

Previous Thread :: Next Thread 
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
18 Dec 2014 04:16 PM
while true do
x = math.random(1,3)
if x == 1 then
script.Parent.Track1:Play()
wait(3)
elseif x == 2 then
script.Parent.Track2:Play()
elseif x == 3 then
script.Parent.Track3:Play()
end
end


issue is that the chances are that it will be playing 5000 of each song at once
Report Abuse
Ruinable is not online. Ruinable
Joined: 14 Sep 2014
Total Posts: 8903
18 Dec 2014 04:17 PM
what

Mr. Mustachio | ( ͡°╭͜ʖ╮͡° )
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
18 Dec 2014 04:19 PM
probably wouldnt fix anything but you could do this

x = math.random(1, 3)
y = math.random(1, 3)
z = math.random(1, 3)
if x == 1 and y == 1 and z == 1 then
Report Abuse
025110 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
18 Dec 2014 04:22 PM
@chim

I only want 1 audio playing at a time
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
18 Dec 2014 04:24 PM
--place the tracks inside the script

script:GetChildren()[math.random(1,#GetChildren())]:Play()
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image