Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Local Sound Overlaps existing Sound Please help?

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

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.