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.