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
 

Button Gui Sound

Previous Thread :: Next Thread 
ColdxN is not online. ColdxN
Joined: 19 Mar 2012
Total Posts: 79
03 Sep 2016 05:34 PM
im trying to make a script where a sound plays when a gui button is clicked but it wont work.

local Sound = script.Parent
function MouseButton1Click:connect
Sound:Play()
end
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Sep 2016 05:38 PM

local Sound = script.Parent
or u can just put the sound into workspace and do
local Sound = game.Workspace.Sound

function MouseClick()
Sound:Play()
end

script.Parent.MouseButton1Down:connect(MouseClick)
Report Abuse
AviatorJake is not online. AviatorJake
Joined: 30 Jan 2014
Total Posts: 1528
03 Sep 2016 05:44 PM
SoundName = "Sound" -- Enter name of sound and put it in the button


script.Parent.MouseButton1Click:connect(function()
script.Parent:FindFirstChild(SoundName):Play()
end)
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