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
 

how do i make a random generator work?

Previous Thread :: Next Thread 
YouTube_LiamTDC is not online. YouTube_LiamTDC
Joined: 09 Mar 2016
Total Posts: 9
09 Jul 2016 12:51 AM
Im trying to make a map where whenever someone hits an invisible wall i made, a song starts to play throughout the entire map. my question is how do i make it select from more than the first item called "Sound" in one place. it keeps taking the first one on the list.

so far this is what i have to make it play the music in my Script i call MusicEngine

local buttonPressed = false
--Store whether the button is pressed in a local variable

Workspace.Checkpoint1.Touched:connect(function(hit)
if not buttonPressed then
-- Is it not pressed?

buttonPressed = true
-- Mark it as pressed, so that other handlers don't execute

print("Button pressed")
game.Workspace.MainShell.Sound:Play()
wait(120)
print("Next Song Plays when Someone starts the level again")
-- Do Stuff

buttonPressed = false
-- Mark it as not pressed, so other handlers can execute again
end
end)

like i said, it works 100% until it plays the same sound instead of randomly picking a sound from the location that they are stored in.
Report Abuse
pidgey is not online. pidgey
Joined: 16 Jan 2008
Total Posts: 2739
09 Jul 2016 01:07 AM
this should help you for what you're trying to do
http://wiki.roblox.com/index.php?title=API:Class/Instance/GetChildren
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions&redirect=no#pairs


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