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

Why isn't this script re-adding playergui on-death?

Asked by 10 years ago
function player_addition(Plyr)
script.Loading_01.Value = true 
Plyr:WaitForChild("PlayerGui")
Plyr.PlayerGui:WaitForChild("Menu")
repeat wait() until Plyr.Character and Plyr.Character.Humanoid.Health >= 5
game.ReplicatedStorage.Loading_Gui:clone().Parent = Plyr.PlayerGui
if Plyr.PlayerGui.Loading_Gui then
print("Found Loading_Gui.")
else
game.ReplicatedStorage.Loading_Gui:clone().Parent = Plyr.PlayerGui
end
Plyr.CharacterAdded:connect(function(Character_01)
Character_01:WaitForChild("Humanoid").Died:connect(function()
if script.Loading_01.Value == true then
repeat wait() until Plyr.Character and Plyr.Character.Humanoid.Health >= 5
Plyr:WaitForChild("PlayerGui")
game.ReplicatedStorage.Loading_Gui:clone().Parent = Plyr.PlayerGui
if Plyr.PlayerGui.Loading_Gui then
print("I have found Loading_Gui.")
else
game.ReplicatedStorage.Loading_Gui:clone().Parent = Plyr.PlayerGui
end
end
end)
end)
end

game.Players.PlayerAdded:connect(player_addition)

The problem is that when I reset it does not give me back my PlayerGui and also does not check if I have it added or not.

1 answer

Log in to vote
0
Answered by 10 years ago

Err... What do you want it to do?

Ad

Answer this question