-- only 2 locals,yeah...


local player = game.Players.LocalPlayer
local char = player.Character
char:WaitForChild("Humanoid").Died:Connect(function() --check if player got oofed
	wait()
	script.Parent.BackgroundTransparency = 0 -- make it not transparent(just to be 100% sure it will be visible after)
	player.CameraMode = 0 -- set third person
	player.CameraMaxZoomDistance = 3 -- lock the camera zoom
    player.CameraMinZoomDistance = 3
	wait(1)
	script.Parent.Deathsound:Play() -- play the sound
	wait(1)
	script.Parent.Visible = true -- make screen go black xd
	player.CameraMaxZoomDistance = 0.5 --reset the zoom
	player.CameraMinZoomDistance = 0.5
	player.CameraMode = 1 -- set first person
	wait(3) -- screen fade out UwU
	script.Parent.BackgroundTransparency = 0.1
	wait(0.3)
	script.Parent.BackgroundTransparency = 0.2
	wait(0.3)
	script.Parent.BackgroundTransparency = 0.3
	wait(0.2)
	script.Parent.BackgroundTransparency = 0.4
	wait(0.2)
	script.Parent.BackgroundTransparency = 0.6
	wait(0.1)
	script.Parent.BackgroundTransparency = 0.8
	wait(0.1)
	script.Parent.BackgroundTransparency = 1
	script.Parent.Visible = false -- make it invisible(just to be sure again)
end)
