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

Making a gui go away FOREVER once pops up?

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

1 comment

0

An easy way is creating the GUI only when the player first joins the server (Using PlayerAdded) then it will only show every server they join. If you want it to be forever, such as playing the game and not getting the GUI in another server, It's DataStore

1 answer

✓ Accepted answer

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

4 comments

0

So this does no go in a frame or button gui?

0

No, you should just be able to put it in the StarterGui

0

Thank you so much! You helped me w/ all my questions in 1 day.

0

Lol, no prob :P

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