I’m making a horror game and I’m working on the UI and I want the creepy music to stop playing when the player has pressed “Play” on the screen I have put the sound in the workspace and the script inside the play text button is:
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Visible = false
game.Workspace["Scary/Creepy Music Box"].playing = false
game.Workspace["Scary/Creepy Music Box"].Looped = false
end)
There’s a function called Sound:Stop(), use it to cease the sounds from it.
However, you need to use the correct type of script and parenting them to the right place. LocalScript should be recommended for the GUI input and depending on the intended behavior, either allow the client to stop it to themselves or the server by sending the signal to the server.