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

How do I get a gui to not reappear into the startergui after someone clicks the play button?

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)

1 answer

✓ Accepted answer

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)

1 comment

0

Thanks!

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