local E=script:FindFirstAncestor("\077\097\105\110\085\073")local S=0 local c=game.Players.LocalPlayer local o=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")return function(E,C,f)local X=game.ReplicatedStorage.Entities.Screech:Clone()local O=math.random(-1,1)*2 if E.dead then return end if O<0 then O=-1.1 end S=S+1 local j=(E.finalCamCFrame.LookVector*Vector3.new(-1,0,-1)+Vector3.new(0,O,0)).unit local r=E.finalCamCFrame.p X:SetPrimaryPartCFrame(CFrame.new(r+j*4,r)*CFrame.new(0,.5,0))X.Parent=E.cam local H={}for E,S in pairs(X.Animations:GetChildren())do if S:IsA("\065\110\105\109\097\116\105\111\110")then H[S.Name]=X.AnimationController:LoadAnimation(S)end end local n=tick()H.Idle:Play()delay(math.random(1,5)/6,function()if X:FindFirstChild("\082\111\111\116")then X.Root.Sound:Play()end end)local v=tick()local s=game:GetService("\082\117\110\083\101\114\118\105\099\101")local w=false local l=X.PrimaryPart.CFrame local M=true local W=X.Base.Attachment.PointLight local F=0 local K=c.Character.Humanoid local T=false local m=c.Character.PrimaryPart local D=false local b=6.5+math.random(1,10)/5 local B=s:BindToRenderStep("\115\099\114\101\101\099\104\083\116\117\102\102"..S,100,function(c)if not w then X.PrimaryPart.CFrame=l else(game:GetService("\082\117\110\083\101\114\118\105\099\101")):UnbindFromRenderStep("\115\099\114\101\101\099\104\083\116\117\102\102"..S)end if M then local S=(E.finalCamCFrame.LookVector.unit-j).Magnitude*100 W.Brightness=math.clamp(50-S,0,50)/50 if S<35 then F=F+c end if F>=.1 or K.Parent:GetAttribute("\072\105\100\105\110\103")then T=true end if not(not game.ReplicatedStorage.GameData.EntityDisableScreech.Value)or not(not m.Anchored)or K.Health<1 then D=true T=false b=0 end end end)E.camShaker:ShakeOnce(.5,12,3,1)for S=1,1000000,1 do task.wait()local c=E.finalCamCFrame.p l=CFrame.new(c+j*3.5,c)*CFrame.new(0,.5,0)if v+b<tick()then break end if T then break end end local A=tick()local q=X.PrimaryPart.CFrame if D or not(not E.tool)and(E.tool.Name=="\067\114\117\099\105\102\105\120"and T==false)or K.Health<1 then local S,c,o=(CFrame.new(Vector3.new(0,0,0),j)):ToOrientation()E.ax_t=math.deg(c)E.ay_t=math.deg(S)wait(.2)game.ReplicatedStorage.EntityInfo.Screech:FireServer(false)else game.ReplicatedStorage.EntityInfo.Screech:FireServer(T)if T then H.Caught:Play()script.Caught:Play()E.camShaker:ShakeOnce(6,42,0,1)else H.Attack:Play()script.Attack:Play()E.camShaker:ShakeOnce(8,42,0,1)end X.Root.Sound:Stop()W.Brightness=1 local S,c,C=(CFrame.new(Vector3.new(0,0,0),j)):ToOrientation()M=false for S=1,1000000,1 do task.wait()local c=E.finalCamCFrame.p l=q:Lerp(CFrame.new(c+j*3.5,c)*CFrame.new(0,.5,0),o:GetValue((tick()-A)/.1,Enum.EasingStyle.Linear,Enum.EasingDirection.In))if A+.1<tick()then break end end local f=tick()for S=1,1000000,1 do task.wait()l=CFrame.new(E.finalCamCFrame.Position+E.finalCamCFrame.LookVector*3,E.finalCamCFrame.Position)*CFrame.new(0,.5,0)if f+2<tick()then break end end end w=true X:Destroy();(game:GetService("\082\117\110\083\101\114\118\105\099\101")):UnbindFromRenderStep("\115\099\114\101\101\099\104\083\116\117\102\102"..S)end


local v1 = script:FindFirstAncestor("MainUI");
local u1 = 0;
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local l__TweenService__3 = game:GetService("TweenService");
return function(p1, p2, p3)
	local v2 = game.ReplicatedStorage.Entities.Screech:Clone();
	local v3 = math.random(-1, 1) * 2;
	if p1.dead then
		return;
	end;
	if v3 < 0 then
		v3 = -1.1;
	end;
	u1 = u1 + 1;
	local l__unit__4 = (p1.finalCamCFrame.LookVector * Vector3.new(-1, 0, -1) + Vector3.new(0, v3, 0)).unit;
	local l__p__5 = p1.finalCamCFrame.p;
	v2:SetPrimaryPartCFrame(CFrame.new(l__p__5 + l__unit__4 * 4, l__p__5) * CFrame.new(0, 0.5, 0));
	v2.Parent = p1.cam;
	local v6 = {};
	for v7, v8 in pairs(v2.Animations:GetChildren()) do
		if v8:IsA("Animation") then
			v6[v8.Name] = v2.AnimationController:LoadAnimation(v8);
		end;
	end;
	local v9 = tick();
	v6.Idle:Play();
	delay(math.random(1, 5) / 6, function()
		if v2:FindFirstChild("Root") then
			v2.Root.Sound:Play();
		end;
	end);
	local v10 = tick();
	local l__RunService__11 = game:GetService("RunService");
	local u4 = false;
	local u5 = v2.PrimaryPart.CFrame;
	local u6 = true;
	local l__PointLight__7 = v2.Base.Attachment.PointLight;
	local u8 = 0;
	local l__Humanoid__9 = l__LocalPlayer__2.Character.Humanoid;
	local u10 = false;
	local l__PrimaryPart__11 = l__LocalPlayer__2.Character.PrimaryPart;
	local u12 = false;
	local u13 = 6.5 + math.random(1, 10) / 5;
	local v12 = l__RunService__11:BindToRenderStep("screechStuff" .. u1, 100, function(p4)
		if not u4 then
			v2.PrimaryPart.CFrame = u5;
		else
			game:GetService("RunService"):UnbindFromRenderStep("screechStuff" .. u1);
		end;
		if u6 then
			local v13 = (p1.finalCamCFrame.LookVector.unit - l__unit__4).Magnitude * 100;
			l__PointLight__7.Brightness = math.clamp(50 - v13, 0, 50) / 50;
			if v13 < 35 then
				u8 = u8 + p4;
			end;
			if u8 >= 0.1 or l__Humanoid__9.Parent:GetAttribute("Hiding") then
				u10 = true;
			end;
			if not (not game.ReplicatedStorage.GameData.EntityDisableScreech.Value) or not (not l__PrimaryPart__11.Anchored) or l__Humanoid__9.Health < 1 then
				u12 = true;
				u10 = false;
				u13 = 0;
			end;
		end;
	end);
	p1.camShaker:ShakeOnce(0.5, 12, 3, 1);
	for v14 = 1, 1000000 do
		task.wait();
		local l__p__15 = p1.finalCamCFrame.p;
		u5 = CFrame.new(l__p__15 + l__unit__4 * 3.5, l__p__15) * CFrame.new(0, 0.5, 0);
		if v10 + u13 < tick() then
			break;
		end;
		if u10 then
			break;
		end;
	end;
	local v16 = tick();
	local l__CFrame__17 = v2.PrimaryPart.CFrame;
	if u12 or (not (not p1.tool) and p1.tool.Name == "Crucifix" and u10 == false or l__Humanoid__9.Health < 1) then
		local v18, v19, v20 = CFrame.new(Vector3.new(0, 0, 0), l__unit__4):ToOrientation();
		p1.ax_t = math.deg(v19);
		p1.ay_t = math.deg(v18);
		wait(0.2);
		game.ReplicatedStorage.EntityInfo.Screech:FireServer(false);
	else
		game.ReplicatedStorage.EntityInfo.Screech:FireServer(u10);
		if u10 then
			v6.Caught:Play();
			script.Caught:Play();
			p1.camShaker:ShakeOnce(6, 42, 0, 1);
		else
			v6.Attack:Play();
			script.Attack:Play();
			p1.camShaker:ShakeOnce(8, 42, 0, 1);
		end;
		v2.Root.Sound:Stop();
		l__PointLight__7.Brightness = 1;
		local v21, v22, v23 = CFrame.new(Vector3.new(0, 0, 0), l__unit__4):ToOrientation();
		u6 = false;
		for v24 = 1, 1000000 do
			task.wait();
			local l__p__25 = p1.finalCamCFrame.p;
			u5 = l__CFrame__17:Lerp(CFrame.new(l__p__25 + l__unit__4 * 3.5, l__p__25) * CFrame.new(0, 0.5, 0), (l__TweenService__3:GetValue((tick() - v16) / 0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In)));
			if v16 + 0.1 < tick() then
				break;
			end;
		end;
		local v26 = tick();
		for v27 = 1, 1000000 do
			task.wait();
			u5 = CFrame.new(p1.finalCamCFrame.Position + p1.finalCamCFrame.LookVector * 3, p1.finalCamCFrame.Position) * CFrame.new(0, 0.5, 0);
			if v26 + 2 < tick() then
				break;
			end;
		end;
	end;
	u4 = true;
	v2:Destroy();
	game:GetService("RunService"):UnbindFromRenderStep("screechStuff" .. u1);
end;
