gorbunovd
|
  |
| Joined: 10 Feb 2012 |
| Total Posts: 21 |
|
|
| 06 Jun 2014 01:35 AM |
I was making a test in # Studio to see if I can make a ######### Play an audio clip on click. So far I watched a few YouTube Tutorials on how to make a button. But there is no tutorial on how to make a button play sound. This is what I have so far with ###########
EXPLORER
###############
#######################################
#############
local Button = script.Parent
function ######### Game.#########.##########
end end
Button.##################################
Is my code good? I tried to test it in Solo Mode but the button did not play the audio. Please reply to this forum post with information on how to solve this problem. Am I missing something in this Forum Post? PM me for more information on this.
Thanks! ^.^ |
|
|
| Report Abuse |
|
|
|
| 06 Jun 2014 01:49 AM |
Your Under 12 filter makes me able to read none of the code u just said.
but i will provide instructions anyway
1. Insert a part into Workspace and then put a clickdetector inside it. 2. Put a script into the part 3. Put this into the script vv
function click() local songlength = 0 -- change 0 to the length of your song local musicid = 0 -- change 0 to the ID of the song (just the numbers ok) enabled = true if enabled == true then enabled = false a = Instance.new("Sound") a.Parent = game.Workspace a.SoundId = musicid a:Play() wait(songlength) a:remove() enabled = true end
script.Parent.ClickDetector.MouseClick:connect(onClick)
hope dis helps :D
|
|
|
| Report Abuse |
|
|
gorbunovd
|
  |
| Joined: 10 Feb 2012 |
| Total Posts: 21 |
|
| |
|
| |
|
gorbunovd
|
  |
| Joined: 10 Feb 2012 |
| Total Posts: 21 |
|
|
| 06 Jun 2014 01:58 AM |
| Although I was hoping for the actual method when using a .#.U.I. Button. Sorry if it blocks the # out in #.U.I. |
|
|
| Report Abuse |
|
|