I have a screen that has the game logo and theres a "Play" button. How do I add music then make the music stop when the player clicks Play? Thanks!
COMMUNITY QUESTION
How do I put an audio into a loading screen then make it stop when the player clicks play?
1 answer
You can just put a sound into a ScreenGui(or anywhere else in the PlayerGui but preferably in a ScreenGui for easier access).
Put this in a ScreenGui in a LocalScript. Make sure there's a sound in the ScreenGui as well as a TextButton.
local gui = script.Parent
local sound = gui:WaitForChild("Sound")
local button = gui:WaitForChild("TextButton")
sound:Play()
button.MouseButton1Click:Connect(function()
sound:Stop()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Thank you so much for the reply! I put a sound then that script in a local script but it's still the same as before. The audio plays and doesn't stop. Is there anything I should rename in that script? The Play is actually an ImageButton so I changed TextButton to ImageButton but it still wont work.
When you changed the text that says "TextButton", did you change it to the name of the ImageButton or just ImageButton? Or is the name already ImageButton?
The image button is named Play so I changed TextButton to Play.
You can just use my answer and edit somethings to your preference. https://scriptinghelpers.org/questions/102160/why-wont-my-while-music-looploop-again