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

Show Gui When player dies ? (UNANSWERED) [closed]

Asked by 10 years ago

I have Made A Gui. I need it to show when the player dies.

So like...

Local player = NEED HELP

if player.Humanoid.Health == 0 then Guisname.Show()

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

3 answers

Log in to vote
0
Answered by 10 years ago
function Died()
plGui = game.Players.LocalPlayer.PlayerGui
scrnGui = Instance.new("ScreenGui",plGui)
fr = Instance.new("Frame",scrnGui)
txt = Instance.new("TextLabel",scrnGui)

fr.Size = UDim2.new(0,2000,0,2000)
fr.BackgroundColor3 = BrickColor.new("Really red").Color
txt.Position = UDim2.new(--[[position you want]]--
txt.Size = UDim2.new(--[[Size u want]]--)
txt.TextScaled = true
txt.Text = "You are dead"
end

if player.Character.Humanoid.Health == 0 then
Died()
end

remember that UDim2 values go as (0,0,0,0) only change the second numbers > (0,1,01)

Ad
Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
 game.Players.PlayerAdded:connect(function(plr)
    player.CharacterAdded:connect(function(chr)
        chr:WaitForChild("Humanoid").Died:connect(function()
            plr:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = true
        end)
    end)
end)


I answered this question before,also it would be beneficial to look up Died() Method on wiki roblox.

Log in to vote
0
Answered by 10 years ago

Try this, do it in a local script though. In the gui = , area put like game.Players.LocalPlayer.PlayerGui.GUINAME.TheFrameName

gui =
if player.Humanoid.Health == 0 then
    gui.Visible = true
end
0
I need to define that player is as in Every player jblade73 18 — 10y