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

Can you help me with this Open/Close Gui?

Asked by 8 years ago

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!

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. connor12260311 383 — 8y
0
Thanks, that was a stupid error totally flew over my head, I am new to scripting. TixyScripter 115 — 8y

Answer this question