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

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.