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

How come my script doesn't work anymore? The ScreenGui just stays there.

Asked by 8 years ago

I'm making it so when a player clicks a button, the ScreenGui disables. However, its not working anymore. How come? This is the code that used to work:

01wait(0.25)
02local Screen = script:WaitForChild('TitleScreenGui')
03local screen = Screen:Clone()
04local play = screen.TitleScreenBox.TitleText.PlayButton
05 
06game.Players.playerAdded:connect(function(player)
07    local startergui = player:WaitForChild('PlayerGui')
08    screen.Parent = startergui
09    screen.Enabled = true
10end)
11 
12play.MouseButton1Down:connect(function(player)
13    screen.Enabled = false
14end)

What happened to my script that made it so it stopped working? Was it an update?

0
Could you try destroying the GUI? CherryLeaves 32 — 8y
0
I did that too, but it still didn't work marioblast1244 113 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
01wait(0.25)
02local Screen = script:WaitForChild('TitleScreenGui')
03local screen = Screen:Clone()
04local play = screen.TitleScreenBox.TitleText.PlayButton
05 
06game.Players.playerAdded:connect(function(player)
07    local startergui = player:WaitForChild('PlayerGui')
08    screen.Parent = startergui
09    screen.Enabled = true
10end)
11 
12play.MouseButton1Down:connect(function(player)
13    screen:Destroy()
14wait(1)
15end)
0
Yeah, that is exactly what I had tried. Just to make sure, I also tried it again, yet it still doesn't work. marioblast1244 113 — 8y
Ad

Answer this question