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: a mathrandom question

Previous Thread :: Next Thread 
TeddGames101 is not online. TeddGames101
Joined: 22 Jul 2013
Total Posts: 10255
08 Dec 2014 05:47 PM
Ok, so I have 3 audios and I want one of the 3 audios to play randomly so that if the player respawns/dies they can hear one of them.
Report Abuse
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
08 Dec 2014 05:54 PM
function DeadlySound()
local math = math.random(3)
if (math==1) then audio1:Play() end
if (math==2) then audio1:Play() end
if (math==3) then audio1:Play() end
end
-- trigger goes here
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
08 Dec 2014 05:55 PM
math.random() takes 0 or 2 arguments.
Report Abuse
CTServant001 is not online. CTServant001
Joined: 01 Feb 2013
Total Posts: 211
08 Dec 2014 05:57 PM
New.BackgroundColor3 = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)



works flawlessly for me, I believe it assumes its 1,# if only 1 argument is present.
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
08 Dec 2014 05:59 PM
oh yeah, forgot about that

Report Abuse
TeddGames101 is not online. TeddGames101
Joined: 22 Jul 2013
Total Posts: 10255
08 Dec 2014 06:21 PM
@CT

That makes all of them play at one same time
Report Abuse
TeddGames101 is not online. TeddGames101
Joined: 22 Jul 2013
Total Posts: 10255
08 Dec 2014 06:25 PM
Oh wait nvm sorry.
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