So when you first start the game there would be a welcome screen GUI. I want to make a close button that destroys the GUI so it doesn't appear again after respawning because that is the current problem I have in my game. I made a local script in the text button and had this code that I made in there. It doesn't work and it just stops the game for 30 seconds.
function destroyGUI()
game.StarterGui.ScreenGui.Frame.TextButton = destroyGUI()
end
script.Parent.MouseButton1Click:Connect(destroyGUI)

1 comment
Try this: