So I had a problem of a GUI not staying after the player died. The GUI was one for a specific player and was added as the player connected. So I tried using this script to add the GUI back after the player died.
while true do
wait(.5)
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
local humanoid=character:WaitForChild("Humanoid")
local hum=character.Humanoid.Health
if hum==0 then
if player.Name=="Player1" then
print("Success!")
end
end
end)
end)
end
I just made it print Success so I could see if it executed the code properly, but nothing happens in the output.
