Hey, I am really new to scripting so I made this gui that destroys itself after someone press the play button but it keeps coming back once the player dies here is the script
Player = game.Players.LocalPlayer Menu = script.Parent Play = Menu.Play function PlayDaGame() Menu:Remove() wait(1) end Play.MouseButton1Down:connect(PlayDaGame)
Set the Visible
property of the GUI to false, thus making it invisible. Then, when a player joins the game, set the Visible
property to true. Since the PlayerAdded
event fires when a player enters, and not each time they respawn, it will not show up if a player respawns.
In a script in workspace, try this:
game.Players.PlayerAdded:connect(function(plr) wait(3) --Helps prevent glitching plr.PlayerGui.ScreenGui.Menu.Visible = true --This path might not be correct, replace it with whatever you have. end)