-- Decompiled with the Synapse X Luau decompiler.

local v1 = script:FindFirstAncestor("MainUI");
local v2 = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v3 = game["Run Service"];
local v4 = {};
local u1 = require(script.Parent);
local u2 = 0;
local u3 = true;
local l__Heart__4 = script.Parent.Parent.Parent:WaitForChild("MainFrame"):WaitForChild("Heartbeat"):WaitForChild("Heart");
local l__TweenService__5 = game:GetService("TweenService");
local u6 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("GetPlatform"));
local u7 = tick();
local u8 = false;
local l__UserInputService__9 = game:GetService("UserInputService");
local u10 = tick();
local l__UserInputService__11 = game:GetService("UserInputService");
game:GetService("ReplicatedStorage").Bricks.ClutchHeartbeat.OnClientEvent:Connect(function(p1, p2)
	if u1.dead == true then
		return;
	end;
	if not p1 or type(p1) ~= "number" then
		p1 = 2;
	end;
	u2 = 0;
	if u3 == true then
		u3 = false;
		u2 = 2.5;
		l__Heart__4.Parent.Visible = true;
		u1.ce.ToggleInventory:Fire(false);
		l__TweenService__5:Create(l__Heart__4.Parent, TweenInfo.new(1.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out, 0, true), {
			BackgroundColor3 = Color3.fromRGB(26, 37, 66), 
			BackgroundTransparency = 0.2
		}):Play();
		local v5 = "TapIcon";
		if u6() == "mobile" then
			v5 = "TapIconMobile";
		end;
		if u6() ~= "console" then
			spawn(function()
				for v6 = 1, 1 do
					for v7, v8 in pairs(l__Heart__4.Parent:GetDescendants()) do
						if v8.Name == v5 then
							v8.Visible = true;
							delay(1, function()
								v8.Left.ImageTransparency = 0;
								l__TweenService__5:Create(v8.Left, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.In), {
									ImageTransparency = 1
								}):Play();
							end);
							delay(2, function()
								v8.Right.ImageTransparency = 0;
								l__TweenService__5:Create(v8.Right, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.In), {
									ImageTransparency = 1
								}):Play();
							end);
						elseif v8.Name == "HalfExampleLeft" then
							local v9 = v8:Clone();
							v9.Name = "DamnDaniel";
							v9.Parent = v8.Parent;
							game.Debris:AddItem(v9, 2);
							l__TweenService__5:Create(v9, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
								ImageTransparency = 0
							}):Play();
							l__TweenService__5:Create(v9, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {
								Position = UDim2.new(0.5, 0, 0.5, 0)
							}):Play();
							delay(1, function()
								l__TweenService__5:Create(v9, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
									ImageTransparency = 1, 
									ImageColor3 = Color3.fromRGB(205, 227, 255), 
									Size = UDim2.new(1.5, 0, 1.5, 0)
								}):Play();
							end);
						elseif v8.Name == "HalfExampleRight" then
							local v10 = v8:Clone();
							v10.Name = "DamnDaniel";
							v10.Parent = v8.Parent;
							game.Debris:AddItem(v10, 3);
							delay(1, function()
								l__TweenService__5:Create(v10, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
									ImageTransparency = 0
								}):Play();
								l__TweenService__5:Create(v10, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {
									Position = UDim2.new(0.5, 0, 0.5, 0)
								}):Play();
								delay(1, function()
									l__TweenService__5:Create(v10, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
										ImageTransparency = 1, 
										ImageColor3 = Color3.fromRGB(205, 227, 255), 
										Size = UDim2.new(1.5, 0, 1.5, 0)
									}):Play();
								end);
							end);
						elseif (v8.Name == "ButtonTapLeft" or v8.Name == "ButtonTapRight") and u6() == "mobile" then
							v8.Visible = true;
							l__TweenService__5:Create(v8, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
								BackgroundTransparency = 0.85
							}):Play();
							l__TweenService__5:Create(v8.UIStroke, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
								Thickness = 5
							}):Play();
						end;
					end;
					wait(2);
				end;
				wait(2);
				for v11, v12 in pairs(l__Heart__4.Parent:GetDescendants()) do
					if v12.Name == v5 then
						v12.Visible = false;
					end;
				end;
			end);
		end;
		l__Heart__4.Engage:Play();
		if p1 >= 4 then
			p1 = p1 - 1;
			wait(1);
		end;
	end;
	coroutine.wrap(function()
		u7 = tick() + p1;
		if u8 == false then
			u8 = true;
			l__Heart__4.Position = UDim2.new(0.5, 0, 2, 0);
			l__Heart__4.Visible = true;
			l__Heart__4.Parent.TapIconConsole.Visible = l__UserInputService__9.GamepadEnabled;
			l__TweenService__5:Create(l__Heart__4, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
				Position = UDim2.new(0.5, 0, 0.95, 0)
			}):Play();
			u1.camShaker:ShakeOnce(1, 2, 0.6, 10);
			u10 = tick();
		end;
		local v13 = true;
		local v14 = 1 - 1;
		while true do
			local v15 = math.random(1, 2);
			local v16 = l__Heart__4:WaitForChild("Half_Left");
			local v17 = "left";
			if v15 == 2 then
				v16 = l__Heart__4:WaitForChild("Half_Right");
				v17 = "right";
			end;
			local v18 = v16:Clone();
			v18.Name = "LiveHalf";
			v18.Visible = true;
			if v15 == 2 then
				v18.Position = v18.Position + UDim2.new(1.5 * p1, 0, 0, 0);
			else
				v18.Position = v18.Position - UDim2.new(1.5 * p1, 0, 0, 0);
			end;
			v18.Parent = l__Heart__4;
			l__TweenService__5:Create(v18, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
				ImageTransparency = 0
			}):Play();
			l__TweenService__5:Create(v18, TweenInfo.new(p1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {
				Position = UDim2.new(0.5, 0, 0.5, 0)
			}):Play();
			local v19 = tick() + p1;
			local u12 = false;
			local u13 = v13;
			local function u14()
				if u1.dead == true then
					l__TweenService__5:Create(l__Heart__4, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
						Position = UDim2.new(0.5, 0, 1.3, 0)
					}):Play();
				end;
				if u12 == false then
					u12 = true;
					u13 = false;
					l__Heart__4.Messup:Play();
					game:GetService("ReplicatedStorage").Bricks.ClutchHeartbeat:FireServer(p2, false);
					u1.camShaker:ShakeOnce(1, 55, 0, 0.8);
					u1.camShaker:ShakeOnce(7, 2, 1, 1);
					l__Heart__4.ActualHeart.ImageColor3 = Color3.fromRGB(165, 27, 27);
					l__TweenService__5:Create(l__Heart__4.ActualHeart, TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
						ImageColor3 = Color3.fromRGB(255, 231, 183)
					}):Play();
					l__TweenService__5:Create(v18, TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
						ImageTransparency = 1, 
						ImageColor3 = Color3.fromRGB(165, 27, 27), 
						Size = UDim2.new(1.5, 0, 1.5, 0)
					}):Play();
					v18.Name = "Jeffery";
				end;
			end;
			task.delay(p1, function()
				local v20 = l__Heart__4.Hit:Clone();
				v20.Name = "LiveSound";
				v20.Parent = l__Heart__4;
				v20:Play();
				game.Debris:AddItem(v20, 3);
				l__Heart__4.ActualHeart.Size = UDim2.new(1.2, 8, 1.2, 8);
				l__TweenService__5:Create(l__Heart__4.ActualHeart, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
					Size = UDim2.new(1, 0, 1, 0)
				}):Play();
				u1.camShaker:ShakeOnce(1, 15, 0.03, 0.1);
				game.Debris:AddItem(v18, 1);
				task.wait(0.199);
				u14();
			end);
			local u15 = nil;
			local u16 = nil;
			local u17 = nil;
			local u18 = v14;
			local function u19(p3)
				local v21 = 99999;
				local v22 = nil;
				for v23, v24 in pairs(l__Heart__4:GetChildren()) do
					if v24.Name == "LiveHalf" then
						local v25 = math.abs(v24.AbsolutePosition.X - l__Heart__4.AbsolutePosition.X);
						if v25 < v21 then
							v21 = v25;
							v22 = v24;
						end;
					end;
				end;
				if v22 == v18 then
					if p3 == v17 and math.abs(tick() - v19) < 0.2 then
						pcall(function()
							u15:Disconnect();
							u16:Disconnect();
							u17:Disconnect();
						end);
						if u13 == true and u18 == 2 then
							game:GetService("ReplicatedStorage").Bricks.ClutchHeartbeat:FireServer(p2, true);
						end;
						if u1.dead == true then
							l__TweenService__5:Create(l__Heart__4, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
								Position = UDim2.new(0.5, 0, 1.3, 0)
							}):Play();
						end;
						l__TweenService__5:Create(v18, TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
							ImageTransparency = 1, 
							ImageColor3 = Color3.fromRGB(126, 245, 255), 
							Size = UDim2.new(1.5, 0, 1.5, 0)
						}):Play();
						u12 = true;
					else
						u14();
					end;
					v18.Name = "Jeffery";
				end;
			end;
			task.delay(u2, function()
				print("connected heartbeat connections");
				u15 = l__UserInputService__11.InputBegan:Connect(function(p4, p5)
					if u8 and (p4.UserInputType == Enum.UserInputType.MouseButton1 or p4.UserInputType == Enum.UserInputType.MouseButton2 or p4.KeyCode == Enum.KeyCode.ButtonL1 or p4.KeyCode == Enum.KeyCode.ButtonL2 or p4.KeyCode == Enum.KeyCode.ButtonR1 or p4.KeyCode == Enum.KeyCode.ButtonR2 or p4.KeyCode == Enum.KeyCode.Q or p4.KeyCode == Enum.KeyCode.E) then
						local v26 = "amongus";
						if p4.UserInputType == Enum.UserInputType.MouseButton1 or p4.KeyCode == Enum.KeyCode.ButtonL1 or p4.KeyCode == Enum.KeyCode.ButtonL2 or p4.KeyCode == Enum.KeyCode.Q then
							v26 = "left";
						elseif p4.UserInputType == Enum.UserInputType.MouseButton2 or p4.KeyCode == Enum.KeyCode.ButtonR1 or p4.KeyCode == Enum.KeyCode.ButtonR2 or p4.KeyCode == Enum.KeyCode.E then
							v26 = "right";
						end;
						u19(v26);
					end;
				end);
				u16 = l__Heart__4.Parent.ButtonTapLeft.MouseButton1Down:Connect(function()
					u19("left");
				end);
				u17 = l__Heart__4.Parent.ButtonTapRight.MouseButton1Down:Connect(function()
					u19("right");
				end);
			end);
			wait(0.25 + p1 / 20);
			if 0 <= 1 then
				if not (u18 < 2) then
					break;
				end;
			elseif not (u18 > 2) then
				break;
			end;
			u18 = u18 + 1;		
		end;
		delay(p1 + 2.5, function()
			if u7 == u7 then
				l__TweenService__5:Create(l__Heart__4, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
					Position = UDim2.new(0.5, 0, 2, 0)
				}):Play();
				for v27, v28 in pairs(l__Heart__4.Parent:GetDescendants()) do
					if v28.Name == "ButtonTapLeft" or v28.Name == "ButtonTapRight" then
						delay(1, function()
							v28.Visible = false;
						end);
						l__TweenService__5:Create(v28, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
							BackgroundTransparency = 1
						}):Play();
						l__TweenService__5:Create(v28.UIStroke, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
							Thickness = 0
						}):Play();
					end;
				end;
				u8 = false;
				l__Heart__4.Parent.TapIconConsole.Visible = false;
				wait(1);
				l__Heart__4.Parent.Visible = false;
				u1.ce.ToggleInventory:Fire(true);
				u3 = true;
			end;
		end);
	end)();
end);