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()
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)
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.
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
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?