Hey, guys! I am trying to make a Gui that appears whenever a player dies in the game, to make a "You died!..." Gui. You might've seen an example of this in Apocalypse Rising, etc. Anyways, this is what I've tried so far:
The Structure: ->StarterGui ->ScreenGui -> Frame ->TextLabel ->Script
Inside the Script:
local Player = script.Parent.Parent.Parent.Parent.Parent
local character = Player.Character
health = character:FindFirstChild("Humanoid")
while true do
if health then
if health.Health <= 0 then
script.Parent.Visible = true
elseif health.Health > 0 then
script.Parent.Visible = false
end
end
end
If anyone can explain to me what I am doing wrong, I'd gladly appreciate it. Thanks!

1 comment
6 Parents not 5