local function A()StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All,false);(TweenService:Create(Overlay,TweenInfo.new(.5),{BackgroundTransparency=.4})):Play();(TweenService:Create(Text,TweenInfo.new(.6),{TextTransparency=0;TextStrokeTransparency=0})):Play()task.wait(2);(TweenService:Create(Text,TweenInfo.new(.6),{TextTransparency=1;TextStrokeTransparency=1})):Play();(TweenService:Create(Overlay,TweenInfo.new(.5),{BackgroundTransparency=0})):Play()local A=Character repeat task.wait()until A~=Character task.wait(1)Overlay:TweenPosition(UDim2.fromScale(-1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5)task.wait(.5)StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All,true)Overlay.Position=UDim2.fromScale(0,0)Overlay.BackgroundTransparency=1 end local X=Humanoid.Died:Connect(A)Player.CharacterAdded:Connect(function()repeat task.wait()until Player.Character Character=Player.Character Humanoid=Character:WaitForChild("\072\117\109\097\110\111\105\100")X:Disconnect()X=Humanoid.Died:Connect(A)end)

local function OnDeath()
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
	TweenService:Create(Overlay, TweenInfo.new(0.5), {BackgroundTransparency = 0.4}):Play()
	TweenService:Create(Text, TweenInfo.new(0.6), {TextTransparency = 0, TextStrokeTransparency = 0}):Play()
	task.wait(2)
	TweenService:Create(Text, TweenInfo.new(0.6), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
	TweenService:Create(Overlay, TweenInfo.new(0.5), {BackgroundTransparency = 0}):Play()
	local OldCharacter = Character
	repeat task.wait() until OldCharacter ~= Character
	task.wait(1)
	Overlay:TweenPosition(UDim2.fromScale(-1,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.5)
	task.wait(0.5)
	StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
	Overlay.Position = UDim2.fromScale(0,0)
	Overlay.BackgroundTransparency = 1
end

local DiedConnection = Humanoid.Died:Connect(OnDeath)

Player.CharacterAdded:Connect(function()
	repeat task.wait() until Player.Character
	Character = Player.Character
	Humanoid = Character:WaitForChild("Humanoid")
	DiedConnection:Disconnect()
	DiedConnection = Humanoid.Died:Connect(OnDeath)
end)
