-- Decompiled with the Synapse X Luau decompiler.

local u1 = require(script.Parent);
local u2 = script:FindFirstAncestor("MainUI");
return function(p1)
	if p1 == "Rush" then
		u1.deathtick = tick() + 10;
		game.SoundService.Main.Volume = 0;
		script.Jumpscare_Rush:Play();
		u2.Jumpscare.Jumpscare_Rush.Visible = true;
		local v1 = tick();
		local v2 = math.random(5, 30) / 10;
		local v3 = v2 + math.random(10, 60) / 10;
		local v4 = 0.25;
		for v5 = 1, 100000 do
			task.wait();
			if v1 + v2 <= tick() then
				u2.Jumpscare.Jumpscare_Rush.ImageLabel.Visible = true;
				v2 = v2 + math.random(7, 44) / 10;
				script.Jumpscare_Rush.Pitch = 1 + math.random(-100, 100) / 500;
				u2.Jumpscare.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
				u2.Jumpscare.Jumpscare_Rush.ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
				v4 = v4 + 0.05;
				u2.Jumpscare.Jumpscare_Rush.ImageLabel.Size = UDim2.new(v4, 0, v4, 0);
			end;
			if v1 + v3 <= tick() then
				break;
			end;
		end;
		u2.Jumpscare.Jumpscare_Rush.ImageLabel.Visible = true;
		script.Jumpscare_Rush:Stop();
		script.Jumpscare_Rush2:Play();
		u2.Jumpscare.Jumpscare_Rush.ImageLabel.Visible = false;
		u2.Jumpscare.Jumpscare_Rush.ImageLabelBig.Visible = true;
		u2.Jumpscare.Jumpscare_Rush.ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
		local v6 = tick();
		for v7 = 1, 1000 do
			local v8 = math.random(0, 10) / 10;
			u2.Jumpscare.Jumpscare_Rush.BackgroundColor3 = Color3.new(v8, v8, math.clamp(math.random(25, 50) / 50, v8, 1));
			u2.Jumpscare.Jumpscare_Rush.ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
			task.wait(0.016666666666666666);
			if v6 + 0.3 <= tick() then
				break;
			end;
		end;
		u2.Jumpscare.Jumpscare_Rush.ImageLabelBig.Visible = false;
		u2.Jumpscare.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, 0);
		u2.Jumpscare.Jumpscare_Rush.Visible = false;
		u1.deathtick = tick();
		return;
	end;
	if p1 ~= "Ambush" then
		return;
	end;
	u1.deathtick = tick() + 10;
	game.SoundService.Main.Volume = 0;
	script.Jumpscare_Ambush:Play();
	u2.Jumpscare.Jumpscare_Ambush.Visible = true;
	local v9 = tick();
	local v10 = math.random(5, 30) / 100;
	local v11 = v10 + math.random(10, 60) / 100;
	local v12 = 0.2;
	for v13 = 1, 100000 do
		task.wait(0.016666666666666666);
		u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-15, 15), 0.5, math.random(-15, 15));
		u2.Jumpscare.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
		if v9 + v10 <= tick() then
			u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Visible = true;
			v10 = v10 + math.random(7, 44) / 100;
			script.Jumpscare_Ambush.Pitch = math.random(35, 155) / 100;
			u2.Jumpscare.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
			u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-25, 25), 0.5, math.random(-25, 25));
			v12 = v12 + 0.05;
			u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Size = UDim2.new(v12, 0, v12, 0);
		end;
		if v9 + v11 <= tick() then
			break;
		end;
	end;
	script.Jumpscare_Ambush2:Play();
	u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Visible = true;
	u2.Jumpscare.Jumpscare_Ambush.ImageLabel:TweenSize(UDim2.new(9, 0, 9, 0), "In", "Quart", 0.3, true);
	local v14 = tick();
	for v15 = 1, 100 do
		local v16 = math.random(0, 10) / 10;
		u2.Jumpscare.Jumpscare_Ambush.BackgroundColor3 = Color3.new(v16, math.clamp(math.random(25, 50) / 50, v16, 1), math.clamp(math.random(25, 50) / 150, v16, 1));
		game["Run Service"].RenderStepped:wait();
		if v14 + 0.3 <= tick() then
			break;
		end;
	end;
	script.Jumpscare_Ambush:Stop();
	u2.Jumpscare.Jumpscare_Ambush.ImageLabel.Visible = false;
	u2.Jumpscare.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, 0, 0);
	u2.Jumpscare.Jumpscare_Ambush.Visible = false;
	u1.deathtick = tick();
end;