I have a problem. There is a button representing a part. When you click on it, the GUI appears for the one who pressed the button. The matter is that all this works perfectly in ROBLOX STUDIO. But the Visible parameter does not change in the game itself.
There is code in Script (not localscript)
function chooseSong(player)
script.Parent.BrickColor = BrickColor.Red()
local person = player.PlayerGui
script.Disabled = true
if player.leaderstats.Coins.Value >= 1000 then
script.Parent.Parent.SongDisplay.SurfaceGui.TextLabel.Text = player.Name.. " chooses music..."
player.PlayerGui.Sound.Frame.Visible = true -- This is doesn't work in ROBLOX Game, but works in ROBLOX STUDIO. There are no errors in the console.
else
print("Nope!")
script.Disabled = false
end
end
script.Parent.ClickDetector.MouseClick:Connect(chooseSong)

5 comments
Once the script is disabled, the rest will not execute.
It's best to use a LocalScript for a GUI object.
Do not pay attention to script.Disabled. How to use Localscript? At me this script works only in Script. If the same script is added to Localscript, then there is no effect.
remoteevents exist for such exceptions
Yes to above, you need a local script and to clone the GUI to the PlayerGUI