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

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

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?

2 comments

0

Could you try destroying the GUI?

0

I did that too, but it still didn't work

1 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)


1 comment

0

Yeah, that is exactly what I had tried. Just to make sure, I also tried it again, yet it still doesn't work.

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