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

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
