Hello everyone, I am making a Gui shop and I want one button to open the shop Gui. That part of my script works and all but I also added a part that plays a sound when you click it because it adds to the button hugely. It doesn't ruin the script but, it doesn't play the sound..

function die()
script.Parent.Parent.ShopGui.Visible = true
Game.Workspace.StartGui.Sound:Play()
wait()
end
script.Parent.MouseButton1Down:connect(die)

Specific Line:

Game.Workspace.StartGui.Sound:Play()

I put the sound in StarterGui because I only want the person who clicked it hear it, that may be a the problem but if you can help I would really appreciate it! Thanks!

2 comments

1

StartGui is not the proper name, it is StarterGui. Second of all, it is not located in workspace, it is an instance located in game. Third of all, if you play a sound in starter gui, it wont update to have the sound being played. so instead of Game.Workspace.StartGui, use script.Parent.Parent.Sound or something.

0

Thanks, that was a stupid error totally flew over my head, I am new to scripting.