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 7 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:

wait(0.25)
local Screen = script:WaitForChild('TitleScreenGui')
local screen = Screen:Clone()
local play = screen.TitleScreenBox.TitleText.PlayButton

game.Players.playerAdded:connect(function(player)
    local startergui = player:WaitForChild('PlayerGui')
    screen.Parent = startergui
    screen.Enabled = true
end)

play.MouseButton1Down:connect(function(player)
    screen.Enabled = false
end)

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 — 7y
0
I did that too, but it still didn't work marioblast1244 113 — 7y

1 answer

Log in to vote
0
Answered by 7 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.
wait(0.25)
local Screen = script:WaitForChild('TitleScreenGui')
local screen = Screen:Clone()
local play = screen.TitleScreenBox.TitleText.PlayButton

game.Players.playerAdded:connect(function(player)
    local startergui = player:WaitForChild('PlayerGui')
    screen.Parent = startergui
    screen.Enabled = true
end)

play.MouseButton1Down:connect(function(player)
    screen:Destroy()
wait(1)
end)


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 — 7y
Ad

Answer this question