I have a gui and when u click "Play" is closes. Then when u die it pops up again!
"Play button that closes it"
script.Parent.MouseButton1Down:connect(function() p = game.Players.LocalPlayer p.PlayerGui.ExampleGui:Destroy() end)
I want this moving gui/frame to close too!
Startposition=script.Parent.Position while true do local RightBorder=script.Parent.AbsolutePosition.X+script.Parent.AbsoluteSize.X if RightBorder<=0 then script.Parent.Position=Startposition else script.Parent.Position=script.Parent.Position-UDim2.new(0.005,0,0,0) end wait() end
A simple way of doing this is by inserting a value into the player when they first join a game, then have the script check if it's already there or not. Try this (In a LocalScript inside the PlayerGui) :
if not game.Players.LocalPlayer:FindFirstChild("First") then Done=Instance.new ("BoolValue",game.Players.LocalPlayer) Done.Name="First" Done.Value=false else game.Players.LocalPlayer.PlayerGui.ExampleGui:Destroy() end
This should work if you use it correctly. If you have any further questions, please leave a comment below. Hope I helped :P