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

How do you make a Popup Gui after you respawn?

Asked by 4 years ago
Edited 4 years ago

How do make a Gui popup after you die and respawn and the GUI is still there I tried this

game.Players.LocalPlayer.Character:WaitForChild('Humanoid').Died:connect(function()
    script.Parent.Frame.Visible = true
end)

and yes it works but it disappears after the player respawns, So I heard you can tweak player's respawn time in This article so what if I set the respawn delay to like 100000 and if the Gui button is pressed the delay will be set to 0.1 or something like that, I don't know how to do all of this stuff so if you could explain it to me or solve it will be greatly appreciated

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

There is a property in every GUI called "ResetOnSpawn". You can set it to true by checking the box, or you can set it to true in a script.

script.Parent.ResetOnSpawn = true

Edit: I just saw what you commented and I hope this is what you were looking for. Feel free to ask questions or say something.

local Player = game.Players.LocalPlayer

Player.Character:WaitForChild('Humanoid').Died:Connect(function() -- Remember to capitalize the C in Connect, as "connect" is deprecated
    script.Parent.Frame.Visible = true
    while true do
        wait(1)
        script.Parent.Close.MouseButton1Click:Connect(function()
            script.Parent.Frame.Visible = false
        end)
        if script.Parent.Frame.Visible == false then
            break -- stops waiting when the Frame is not visible
        end
    end
    wait(0.1)
    Player:LoadCharacter()
end)
0
I didn't mean it like that!!! I meant once a player dies he will get a popup that will no go as long as he doesn't close the Gui window so the "X" button Smartics 25 — 4y
0
So I understand that you want a GUI to pop up when a player dies, but then you don't want the player to respawn until they close that GUI. AntiWorldliness 868 — 4y
0
I already edited my answer. Feel free to ask questions. AntiWorldliness 868 — 4y
0
Hello LoveSpeaksOutTruth tysm for your answer, but it didn't quite work! I screenShot my studio so you get a better understanding of my layout in here https://ibb.co/RBhRJ4R when I put your local script under my frame it doesn't show the Gui as agian I want the Gui To stay there until the player chooses the option "X" Close" and then he respawns and that's it. Sorry if I am asking too much Smartics 25 — 4y
0
Thank you for the screenshot because it helped. I tried something different, and it worked when I tested it out. Keep asking if you need help because it doesn't bother me at all! AntiWorldliness 868 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Add a wait() to it!

game.Players.LocalPlayer.Character:WaitForChild('Humanoid').Died:connect(function()
    wait() -- put how long the player takes  to respawn, maybe add an extra half a second to it just to be safe
    script.Parent.Frame.Visible = true
end)
0
Or, do you want the plr to respawn after pressing the X? R_LabradorRetriever 198 — 4y
0
Yes, I want the player to respawn after pressing the "X" button Smartics 25 — 4y
0
kk R_LabradorRetriever 198 — 4y

Answer this question