Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Local Sound Overlaps existing Sound Please help?

Asked by 9 years ago

Hello Im Making a Gui that when the player clicks the button it plays a sound it plays the sound but when the player dies it plays the song again and loops over it This script below is a Local Script Inside the GUI

Player = game.Players.LocalPlayer
s1 = script.Parent.Sound1
s2 = script.Parent.Sound2
play = script.Parent.Frame.Play
mousepressedPlay = false
box = script.Parent.Frame

function MouseEnterPlayButton()
    play.FontSize = "Size48"
    s1:play()
    box:remove()



end
function MouseLeftPlayButton()
    play.FontSize = "Size24"
    s1:play()
    if  then

    end
end
function PlayGame()
    if mousepressedPlay == false then
        s2:Play()
        wait(3)
        s2:remove()


    end



end

play.MouseEnter:connect(MouseEnterPlayButton)
play.MouseEnter:connect(MouseLeftPlayButton)
play.MouseButton1Down:connect(PlayGame)

1 answer

Log in to vote
-1
Answered by 9 years ago

if I did

box = script.Parent.Frame
gui = game.StarterGui["Welcome GUI"]
function MouseLeftPlayButton()
    play.FontSize = "Size24"
    s1:play()
    box:Destroy()
    wait(4)
    gui:Destroy()
end

Instead Would That Work?
Ad

Answer this question