Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

if player died the gui visible forever until he clicks the button.:?

game.Players.LocalPlayer.Character:WaitForChild('Humanoid').Died:connect(function()
	script.Parent.DeadGui.Visible = true
	wait(999999999999999999999999)
end)

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.