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

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

Asked by 2 years ago

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)
0
StarterGui just replicates it's contents into the PlayerGui MarkedTomato 810 — 2y
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 MarkedTomato 810 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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.

Ad

Answer this question