game.Players.LocalPlayer.Character:WaitForChild('Humanoid').Died:connect(function()
script.Parent.DeadGui.Visible = true
wait(999999999999999999999999)
end)
COMMUNITY QUESTION
if player died the gui visible forever until he clicks the button.:?
1 answer
First off, you should use :Connect() instead of :connect() due to it being deprecated. Secondly, the wait is very unenesessary because you are doing nothing after it. Also, if you ever want to get infinite, you can use
math.huge
All the script needs to be is:
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
script.Parent.DeadGui.Visible = true
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
