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

How do I make a GUI disappear, even after the person respawns?

Asked by 9 years ago

I'm working on a GUI that gives you cash when you click it, and then it disappears, forever.

I've tried to make visible false, remove it, destroy it, move it to the workspace, and they all work, until you respawn and the GUI is back.

Any help is appreciated.

2 answers

Log in to vote
1
Answered by
Nifer2 174
9 years ago

Don't put the script inside the StarterGui. If that is where you put it, then it will always come back every time you respawn. Instead, leave it in the Workspace or somewhere else and make it clone to the player when they join the game and spawn.

gui = -- Add gui's location relative to the script.

game.Players.PlayerAdded:connect(function(player)
    local a = gui:clone()
    a.Parent = player.StarterGui
end)
Ad
Log in to vote
0
Answered by 9 years ago

Sort of like what Nifer said, but again he screwed up a bit.

gui=game.Lighting.CashGui --Change to the Name

game.Players.PlayerAdded:connect(function(player)
wait()
gui:lone().Parent=player.PlayerGui
end)

Answer this question