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

Help with gui script?

Asked by
steev 0
10 years ago

I have a Gui and when the player clicks on the button it disappears. The only problem is when they respawn it pops up again. I want this to not pop up again once they have respawned.

wait(1)

script.Parent.Main.Close.MouseButton1Down:connect(function()
script.Parent:remove()
end)


Thank you.

2 answers

Log in to vote
-1
Answered by
iLegitus 130
10 years ago

Put the gui in replicated storage. Put this inside a script(Not local)

game.Players.PlayerAdded:connect(function(player)
    g = game.ReplicatedStorage.GUINAMEHERE:Clone()
    g.Parent = player.PlayerGui
end)
0
Doesn't work. steev 0 — 10y
0
Right ill come up with something... iLegitus 130 — 10y
0
Did you replace the GUINAMEHERE with your gui's actual name? iLegitus 130 — 10y
Ad
Log in to vote
-1
Answered by
RoboFrog 400 Moderation Voter
10 years ago

You could always create a boolean value for each player when they spawn, and once the GUI closes, the boolean value changes to true or false (your pick). You could then modify your script to check if that value is true or false, and only activate on one of them.

EDIT:

To make this seem a bit more possible, I'd suggest placing a boolean value into the player when they join. Assuming your script above is a local script, you can easily locate the boolean inside of the player through the use of LocalPlayer.

Answer this question