You simply don’t need that end) there. Also, it’s :FindFirstChild, not .FindFirstChild. Actually, you can’t use MouseButton1Click in an if statement either.
The red underline means that it’s not valid syntax, so still no. You have two ends for one open block, and you don’t ever call sound1:Stop() as a function (you just reference the function without calling it).
If you hover over the red underline, it gives helpful information about what’s wrong.
Okay, to begin with, you need to call player.PlayerGui, and not just “ScreenGui.” Secondly, it is :FindFirstChild, not .FindfirstChild(). And lastly, you don’t need that if statement there at all.
needs to be in a local script. Everything else can stay there. You will need to access the welcomeSound in some way, so maybe in your server script say welcomeSound.Name = "welcomeSound"
and then in your local script define welcome sound as welcomeSound = workspace.welcomeSound
First of all, define welcomeSound before the clicked function, and you can put the script inside of the GUI if you would like to. Oh and you need to change the name of the sound you are creating in the server script. Just do this in the server script welcomeSound.Name = "welcomeSound"
That looks all good. You can add a “local” before welcomeSound in the local script, but it won’t affect the functionality of the script, it will just get rid of the orange underline.
Also, it doesnt matter where you put the script since it does not change how it finds the path to the Button. As long as it is in somewhere that gets cloned to the player(inside a GUI or in starterplayerscripts) it should work.