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

I made a script that when a specific sound plays, a timer should appear, but the timer wont appear?

The script:

game.Workspace.Meltdown.Music6.Played:Connect(function(SoundId)
	script.Parent.Parent.StarterGui.ScreenGui.Enabled = true
	script.Parent.Parent.StarterGui.ScreenGui.TextLabel.LocalScript.Disabled = false
end)

2 comments

0

StarterGui just replicates it's contents into the PlayerGui

0

PlayerGui is the child of every client. Every client is located in players service. Do this from a LocalScript since we're changing it for the client. Using game.Players.LocalPlayer will get the client

1 answer

✓ Accepted answer

If the script is a localscript then this should fix it:

game.Workspace.Meltdown.Music6.Played:Connect(function(SoundId)
   game.Players.LocalPlayer.PlayerGui.ScreenGui.Enabled = true
   game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.LocalScript.Disabled = false
end)

The startergui replicates gui's into your playergui, so if you want to change any guis you have on the players screen(doesnt matter if its unvisible or stuff) you have to check in playergui.

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