game.Players.PlayerAdded:Connect(function(plr)
local gui = plr.PlayerGui
plr.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid").died:Connect(function()
print(plr.Name.." / Dead : true")
game.workspace.DiedSound:Play()
gui.DeadScreen.TextDead.Visible = true -- the problem is here
end)
end)
end)
when i try and i kill my character the output say that DeadScreen is not a valid member of PlayerGui

2 comments
You cannot get PlayerGui from a serverScript, you need a localscript to get PlayerGui
Put the gui somewhere else and clone it to playergui on the died event