Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making a gui go away FOREVER once pops up?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

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
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 alphawolvess 1784 — 9y

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
9 years ago

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

0
So this does no go in a frame or button gui? FiredDusk 1466 — 9y
0
No, you should just be able to put it in the StarterGui dyler3 1510 — 9y
0
Thank you so much! You helped me w/ all my questions in 1 day. FiredDusk 1466 — 9y
0
Lol, no prob :P dyler3 1510 — 9y
Ad

Answer this question