--// im not gonna comment this :troll:

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)
