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

why wont this script work?

function Click()
	Game.StarterGui.Music.SoundId = "rbxassetid://142478510"
	Game.StarterGui.Music:Play()
	wait(120)
	Game.StarterGui.Music.SoundId = "rbxassetid://142478390"
	Game.StarterGui.Music:Play()
end
script.Parent.MouseButton1Down:connect(Click)

1 answer

The StarterGui is just a container for GUI objects. When a player spawns, the items in StarterGui are copied into the player's PlayerGui. So if you play a Sound in StarterGui, no one will hear it.

Assuming this is a LocalScript, and you put it inside your GUI, you should be playing the "Music" sound object that exists in the script's parent.

e.g.

	local music = script.Parent.Music
	music.SoundId = "rbxassetid://142478510"
	music:Play()

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