Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

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

Closed as Non-Descriptive by User#24403 and Gey4Jesus69

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)
Ad