local c=script:FindFirstAncestor("\077\097\105\110\085\073")local E=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local w=game.Players.LocalPlayer return function(Q,g)if Q.dead then return end if w.Character:GetAttribute("\072\105\100\105\110\103")==false then return end local F=game.Lighting.Sanity:Clone()F.Name="\076\105\118\101\083\097\110\105\116\121"F.Enabled=true F.Parent=game.Lighting local r=c.SanityVignette:Clone()r.Name="\076\105\118\101\083\097\110\105\116\121\086\105\103\110\101\116\116\101"r.Visible=true r.Parent=c local J=game.SoundService.Main.SanityEqualizer:Clone()J.Name="\083\097\110\105\116\121\069\113\117\097\108\105\122\101\114\076\105\118\101"J.Enabled=true J.Parent=game.SoundService.Main local Z=script.Heartbeat:Clone()Z.Name="\076\105\118\101\072\101\097\114\116\098\101\097\116"Z.Parent=script Z:Play()local o=script.Whispers:Clone()o.Name="\076\105\118\101\087\104\105\115\112\101\114\115"o.Parent=script o:Play()local j=script.Static:Clone()j.Name="\076\105\118\101\083\116\097\116\105\099"j.Parent=script j:Play();(E:Create(F,TweenInfo.new(g,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{Saturation=-0.8;Contrast=.3,TintColor=Color3.new(1,.9,.92)})):Play();(E:Create(r,TweenInfo.new(g*.66,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{ImageTransparency=0;Size=UDim2.new(1.2,0,1.2,0)})):Play();(E:Create(r.DamageVignette,TweenInfo.new(g,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut),{ImageTransparency=0})):Play();(E:Create(J,TweenInfo.new(g,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut),{LowGain=0;MidGain=-20,HighGain=-40})):Play();(E:Create(Z,TweenInfo.new(g,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{PlaybackSpeed=2})):Play();(E:Create(o,TweenInfo.new(g,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{PlaybackSpeed=2})):Play();(E:Create(Z,TweenInfo.new(g,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Volume=1.6})):Play();(E:Create(o,TweenInfo.new(g,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Volume=1.6})):Play()local p=Q.camShaker:StartShake(1,16,g,Vector3.new(0,0,0))local t=Q.camShaker:StartShake(8,1,g,Vector3.new(0,0,0))local T=tick()+g local i=tick()+g/2 local N=true local X=c.Jumpscare_Hide task.spawn(function()pcall(function()while N do task.wait()local c=math.clamp((Z.PlaybackLoudness*Z.Volume)/1000,0,.8)r.DamageVignette.ImageColor3=Color3.new(.1+c,c/4,c/4)X.Static.Position=UDim2.new(math.random(0,100)/100,0,math.random(0,100)/100,0)X.Static.Rotation=math.random(0,1)*180 X.Static.ImageTransparency=(1-c)-math.clamp((o.PlaybackLoudness*o.Volume)/1000,0,.8)end end)end)X.Visible=true task.spawn(function()for c=1,10000,1 do task.wait(.033333333333333)if i<=tick()then if math.random(1,20)==5 then X.Overlay.Position=UDim2.new(math.random(30,70)/100,0,math.random(30,70)/100,0)X.Overlay.Visible=true j.Volume=.12 else X.Overlay.Visible=false j.Volume=0 end end if T<=tick()then end if Q.camlock==nil then break end if Q.dead then break end if w.Character:GetAttribute("\072\105\100\105\110\103")==false then break end end end)task.wait(10)w.Character:SetAttribute("\072\105\100\101\083\105\099\107\110\101\115\115",true)Q.camShaker:ShakeOnce(72,22,0,2,Vector3.new(0,0,0))Q.camShaker:ShakeOnce(3,6,0,18,Vector3.new(0,0,0))Q.camShaker:ShakeOnce(12,.5,0,18,Vector3.new(0,0,0))X.Overlay.Visible=false j.Volume=0;(E:Create(F,TweenInfo.new(.06,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,true),{Brightness=.5})):Play()script.Scare:Play()wait(2);(E:Create(F,TweenInfo.new(15,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Saturation=0,Contrast=0,TintColor=Color3.new(1,1,1)})):Play();(E:Create(r,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{ImageTransparency=1,Size=UDim2.new(1.6,0,1.6,0)})):Play();(E:Create(r.DamageVignette,TweenInfo.new(15,Enum.EasingStyle.Quart,Enum.EasingDirection.In),{ImageTransparency=1})):Play();(E:Create(J,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.In),{LowGain=0;MidGain=0,HighGain=0})):Play();(E:Create(Z,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{PlaybackSpeed=1.2})):Play();(E:Create(o,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut),{PlaybackSpeed=1})):Play();(E:Create(Z,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Volume=0})):Play();(E:Create(o,TweenInfo.new(15,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Volume=0})):Play()wait(15)N=false F:Destroy()r:Destroy()J:Destroy()Z:Destroy()o:Destroy()j:Destroy()X.Visible=false w.Character:SetAttribute("\072\105\100\101\083\105\099\107\110\101\115\115",false)end


local u1 = script:FindFirstAncestor("MainUI");
local l__TweenService__2 = game:GetService("TweenService");
local l__LocalPlayer__3 = game.Players.LocalPlayer;
return function(p1, p2)
	if p1.dead then
		return;
	end;
	if l__LocalPlayer__3.Character:GetAttribute("Hiding") == false then
		return;
	end
	local v1 = game.Lighting.Sanity:Clone();
	v1.Name = "LiveSanity";
	v1.Enabled = true;
	v1.Parent = game.Lighting;
	local v2 = u1.SanityVignette:Clone();
	v2.Name = "LiveSanityVignette";
	v2.Visible = true;
	v2.Parent = u1;
	local v3 = game.SoundService.Main.SanityEqualizer:Clone();
	v3.Name = "SanityEqualizerLive";
	v3.Enabled = true;
	v3.Parent = game.SoundService.Main;
	local v4 = script.Heartbeat:Clone();
	v4.Name = "LiveHeartbeat";
	v4.Parent = script;
	v4:Play();
	local v5 = script.Whispers:Clone();
	v5.Name = "LiveWhispers";
	v5.Parent = script;
	v5:Play();
	local v6 = script.Static:Clone();
	v6.Name = "LiveStatic";
	v6.Parent = script;
	v6:Play();
	l__TweenService__2:Create(v1, TweenInfo.new(p2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {
		Saturation = -0.8, 
		Contrast = 0.3, 
		TintColor = Color3.new(1, 0.9, 0.92)
	}):Play();
	l__TweenService__2:Create(v2, TweenInfo.new(p2 * 0.66, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		ImageTransparency = 0, 
		Size = UDim2.new(1.2, 0, 1.2, 0)
	}):Play();
	l__TweenService__2:Create(v2.DamageVignette, TweenInfo.new(p2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut), {
		ImageTransparency = 0
	}):Play();
	l__TweenService__2:Create(v3, TweenInfo.new(p2, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut), {
		LowGain = 0, 
		MidGain = -20, 
		HighGain = -40
	}):Play();
	l__TweenService__2:Create(v4, TweenInfo.new(p2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		PlaybackSpeed = 2
	}):Play();
	l__TweenService__2:Create(v5, TweenInfo.new(p2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
		PlaybackSpeed = 2
	}):Play();
	l__TweenService__2:Create(v4, TweenInfo.new(p2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
		Volume = 1.6
	}):Play();
	l__TweenService__2:Create(v5, TweenInfo.new(p2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
		Volume = 1.6
	}):Play();
	local v7 = p1.camShaker:StartShake(1, 16, p2, Vector3.new(0, 0, 0));
	local v8 = p1.camShaker:StartShake(8, 1, p2, Vector3.new(0, 0, 0));
	local v9 = tick() + p2;
	local v10 = tick() + p2 / 2;
	local u4 = true;
	local l__Jumpscare_Hide__5 = u1.Jumpscare_Hide;
	task.spawn(function()
		pcall(function()
			while u4 do
				task.wait();
				local v11 = math.clamp(v4.PlaybackLoudness * v4.Volume / 1000, 0, 0.8);
				v2.DamageVignette.ImageColor3 = Color3.new(0.1 + v11, v11 / 4, v11 / 4);
				l__Jumpscare_Hide__5.Static.Position = UDim2.new(math.random(0, 100) / 100, 0, math.random(0, 100) / 100, 0);
				l__Jumpscare_Hide__5.Static.Rotation = math.random(0, 1) * 180;
				l__Jumpscare_Hide__5.Static.ImageTransparency = 1 - v11 - math.clamp(v5.PlaybackLoudness * v5.Volume / 1000, 0, 0.8);			
			end;
		end);
	end);
	l__Jumpscare_Hide__5.Visible = true;
	task.spawn(function()
		for v12 = 1, 10000 do
			task.wait(0.03333333333333333);
			if v10 <= tick() then
				if math.random(1, 20) == 5 then
					l__Jumpscare_Hide__5.Overlay.Position = UDim2.new(math.random(30, 70) / 100, 0, math.random(30, 70) / 100, 0);
					l__Jumpscare_Hide__5.Overlay.Visible = true;
					v6.Volume = 0.12;
				else
					l__Jumpscare_Hide__5.Overlay.Visible = false;
					v6.Volume = 0;
				end;
			end;
			if v9 <= tick() then

			end;
			if p1.camlock == nil then
				break;
			end;
			if p1.dead then
				break;
			end;
			if l__LocalPlayer__3.Character:GetAttribute("Hiding") == false then
				break;
			end
		end;
	end)
	--v7:StartFadeOut(0.3);
	--v8:StartFadeOut(0.3);
	task.wait(10)
	--if p1.dead == false then
		l__LocalPlayer__3.Character:SetAttribute("HideSickness", true)
		p1.camShaker:ShakeOnce(72, 22, 0, 2, Vector3.new(0, 0, 0));
		p1.camShaker:ShakeOnce(3, 6, 0, 18, Vector3.new(0, 0, 0));
		p1.camShaker:ShakeOnce(12, 0.5, 0, 18, Vector3.new(0, 0, 0));
		l__Jumpscare_Hide__5.Overlay.Visible = false;
		v6.Volume = 0;
		l__TweenService__2:Create(v1, TweenInfo.new(0.06, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, true), {
			Brightness = 0.5
		}):Play();
		script.Scare:Play();
		wait(2);
		l__TweenService__2:Create(v1, TweenInfo.new(15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
			Saturation = 0, 
			Contrast = 0, 
			TintColor = Color3.new(1, 1, 1)
		}):Play();
		l__TweenService__2:Create(v2, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
			ImageTransparency = 1, 
			Size = UDim2.new(1.6, 0, 1.6, 0)
		}):Play();
		l__TweenService__2:Create(v2.DamageVignette, TweenInfo.new(15, Enum.EasingStyle.Quart, Enum.EasingDirection.In), {
			ImageTransparency = 1
		}):Play();
		l__TweenService__2:Create(v3, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {
			LowGain = 0, 
			MidGain = 0, 
			HighGain = 0
		}):Play();
		l__TweenService__2:Create(v4, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
			PlaybackSpeed = 1.2
		}):Play();
		l__TweenService__2:Create(v5, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
			PlaybackSpeed = 1
		}):Play();
		l__TweenService__2:Create(v4, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
			Volume = 0
		}):Play();
		l__TweenService__2:Create(v5, TweenInfo.new(15, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
			Volume = 0
		}):Play();
		wait(15);
	--[[else
		v7:StartFadeOut(0.3);
		v8:StartFadeOut(0.3);
	end;]]
	u4 = false;
	v1:Destroy();
	v2:Destroy();
	v3:Destroy();
	v4:Destroy();
	v5:Destroy();
	v6:Destroy();
	l__Jumpscare_Hide__5.Visible = false;
	l__LocalPlayer__3.Character:SetAttribute("HideSickness", false)
end;
