Making A Death Screen

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A GUI screen appears on the players screen after death, and has the option to respawn.

Hello Everyone! So im making a miliary game and i decided to make a GUI where players can select the option to respawn by pressing a button.

Heres the GUI, however i don’t know how to script and require assistance. Thanks

2 Likes

You can use Player.Character.Humanoid.Died to listen out for when the player dies, then show the UI.
Listen out for Player.CharacterAdded to hide the UI when they respawn.
You do have to do this in a specific way, however, since the Character instance is changed each time. Here’s how I would do it:

local Players = game:GetService("Players")

Players.LocalPlayer.CharacterAdded:Connect(function(character)
    -- Hide GUI
    character.Humanoid.Died:Once(function()
        -- Show GUI
    end)
end)

I used Once instead of Connect here for the Humanoid.Died connection, as we only want to run the code to show the GUI once for each character.
If we use Connect, then the connection will persist, meaning that each time the death event is fired, the code will run for as many times as the player has died in total.

4 Likes

im pretty sure there are plenty tutorials on youtube for this, no need to ask people to babysit you

2 Likes

True, but i prefer to learn from the community instead of copy pasting.

2 Likes

Personally, I think that these are some kind of bots that create the appearance of activity in this forum.

what bots?
everyone is human from what im aware of

Mom doesn’t let me talk to robots.

i think he’s talking about the replies, and by that i mean the people ‘‘helping’’ you code.

they kind of are, im figuring the scripts out by myself, it doesnt work yet

Absolutely not, I’m talking about those people who have access to forums and they ask such easy questions that can be found by writing the same forum title in Google. Although I probably shouldn’t run into them, because they are the ones who help us get +1 to the solutions in the profile.

oh true, this could be easily found on some random tutorial on yotube, i dare to say a free model even

i prefer making everything by myself, or even a little bit of help to be honest. You never know whats lurking in the free models

respect that, however you can absolutely learn from youtube tutorials. also, i personally value speed a lot, so if i can do something quicker, achieve the same goal and learn, i’m doing that.

i can agree with you on this comment, still i prefer to use the community, i do use tutorials aswell when i am in need of quick help

1 Like

no problem, have a nice day and i hope you can figure this out!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.