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

How To Make A ScreenGui Disappear Permanently And Not Appear After Death?

Asked by 8 years ago

Thanks for looking at my question, I'll dive right into it.

So Basically...

I want a ScreenGui to be removed forever and ever once a player clicks a certain button. I've tried using function HasPressedPlay() and if they pressed play, then script.Parent.Parent.Parent.Parent = nilbut whenever I die AKA reset, The ScreenGui would still appear. I would suggest try using onDied Event() but I wouldn't know how to. So I think checking and keeping a record on a player if they pressed play, and if they leave the game, the record will be deleted and will be kept anew. I know this is confusing, which is completely my fault, but there's some theorems to help you guys solve my problem. So, can you help me? Thank you!

GreekGodOfMLG

1 answer

Log in to vote
1
Answered by 8 years ago

Alright. Firstly insert a script into workspace and put your desired gui in it.

Now put this code in the script:

game.Players.PlayerAdded:connect(function(player)
    repeat wait() until player.Character
    repeat wait() until player.Character:FindFirstChild("Humanoid")
    local gui = script.GuiName:Clone() -- change 'GuiName' to your gui's name
    gui.Parent = player.StarterGui
end)

Now all you have to do is when the player click the play button, destroy the gui and the gui won't even come back unless the player rejoins.

If you have any more questions about this, or any other topics, Feel free to shoot me a tweet @ObscureRBLX or send me a PM (my username is ObscureEntity)

0
There was an error with your code, StarterGui should've been PlayerGui, but when I changed it, it worked! Thank you ObscureEntity, I'll be sure to Accept your Answer and upvote you as well! GreekGodOfMLG 244 — 8y
1
Sorry about that, I should know better. I typed it in the box instead of in studio to test it. I've been doing complex formulas all day and am tired lol. If you need more help, I'm usually doing nothing too important, so feel free to ask. ObscureEntity 294 — 8y
Ad

Answer this question