|
| 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
|
  |
| 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 |
|