The title says it, is it possible? Please post below.
01 | local button = --Button location |
02 | local sound = --sound location |
03 | local clicked = false |
04 |
05 | button.MouseButton 1 Down:Connect( function () |
06 | if not clicked then |
07 | clicked = true |
08 | sound:Play() |
09 | end |
10 | end ) |
if any errors, please mention.
This is possible, first things first is to make a gui, and design it to your preference, then insert a localscript into the gui.
1 | local Button = --Button Destination |
Now what you need to do is at in when a player clicks on the gui, music will play, what I'd suggest is adding music to "replicatedstorage"
1 | Button.MouseButton 1 Down:connect( function () |
2 |
3 | game.ReplicatedStorage. [ MUSICNAME ] :play() |
4 | end ) |
Also, make sure to add the id of the music you wish played into the properties of your sound.
If you encounter any errors, please do tell.
You need to have a audio/sound object under the text button. and need to add a function to it if the text button is clicked on and triggering the audio to play.
1 | local button = script.Parent.Parent.TextButton |
2 | local audio = button.Parent.Audio |
3 |
4 | button.MouseButton 1 Clicked:connect( function () |
5 | wait(. 1 ) |
6 | audio:Play() |
7 | end |
may need to change things around to get the script working correctly.
If this worked please accept this answer. Thank you.
-Mohawkid14
Note: Remember don't ask for us to give you a script. That is violating the terms of this site.