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 » Scripting Helpers
Home Search
 

Re: how to make a sound play when a gui is clicked

Previous Thread :: Next Thread 
ultralaser360 is not online. ultralaser360
Joined: 02 Oct 2011
Total Posts: 784
18 Jul 2014 03:56 PM
I made this script but for some reason it did work

game.StarterGui.ScreenGui.buttons.Play.MouseButton1Click:connect(function()

script.Parent:Play()
end)

did I make a mistake?
Report Abuse
ultralaser360 is not online. ultralaser360
Joined: 02 Oct 2011
Total Posts: 784
18 Jul 2014 03:57 PM
i forgot to mention that the sound is in the work space and the gui is in the startergui

Report Abuse
XXahraternotXX is not online. XXahraternotXX
Joined: 03 Jan 2009
Total Posts: 221
18 Jul 2014 04:03 PM
Try:

function OnClicked()
game.Workspace.Sound:Play()
end

script.Parent.MouseButtion1Click:connect(OnClicked)
Report Abuse
ultralaser360 is not online. ultralaser360
Joined: 02 Oct 2011
Total Posts: 784
18 Jul 2014 04:36 PM
That didnt seem to work
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
18 Jul 2014 04:41 PM


game.Players.LocalPlayer.PlayerGui.ScreenGui.buttons.Play.MouseButton1Click:connect(function()

script.Parent:Play()
end)
Report Abuse
Durfungus is not online. Durfungus
Joined: 07 Feb 2009
Total Posts: 15988
18 Jul 2014 06:12 PM
were is the script
and where is the gui

Currently have 46k R$ [HELP, DURFUNGUS IS SPREADING] Twitter - @Durfungus
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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