local V=game:GetService("\080\108\097\121\101\114\115")local L do local V,B=pcall(function()return(UserSettings()):IsUserFeatureEnabled("\085\115\101\114\080\111\112\112\101\114\099\097\109\076\111\111\115\101\079\112\097\099\105\116\121\084\104\114\101\115\104\111\108\100")end)L=V and B end local B=game.Workspace.CurrentCamera local U=math.min local A=math.tan local m=math.rad local X=math.huge local d=Ray.new local function i(V)return 1-(1-V.Transparency)*(1-V.LocalTransparencyModifier)end local function f(V,L)for L=#V,L+1,-1 do V[L]=nil end end local Z,h,g do local function V()local V=m(B.FieldOfView)local L=B.ViewportSize local U=L.X/L.Y g=2*A(V/2)h=U*g end;(B:GetPropertyChangedSignal("\070\105\101\108\100\079\102\086\105\101\119")):Connect(V);(B:GetPropertyChangedSignal("\086\105\101\119\112\111\114\116\083\105\122\101")):Connect(V)V()Z=B.NearPlaneZ;(B:GetPropertyChangedSignal("\078\101\097\114\080\108\097\110\101\090")):Connect(function()Z=B.NearPlaneZ end)end local q={}do local L={}local function B()local V=1 q={}for L,B in pairs(L)do q[V]=B V=V+1 end end local function U(V)local function U(U)L[V]=U B()end local function A()L[V]=nil B()end V.CharacterAdded:Connect(U)V.CharacterRemoving:Connect(A)if V.Character then U(V.Character)end end local function A(V)L[V]=nil B()end V.PlayerAdded:Connect(U)V.PlayerRemoving:Connect(A)for V,L in ipairs(V:GetPlayers())do U(L)end B()end
--------------------------------------------------------------------------------
-- Popper.lua
-- Prevents your camera from clipping through walls.
--------------------------------------------------------------------------------

local Players = game:GetService("Players")

local FFlagUserPoppercamLooseOpacityThreshold
do
	local success, enabled = pcall(function()
		return UserSettings():IsUserFeatureEnabled("UserPoppercamLooseOpacityThreshold")
	end)
	FFlagUserPoppercamLooseOpacityThreshold = success and enabled
end

local camera = game.Workspace.CurrentCamera

local min = math.min
local tan = math.tan
local rad = math.rad
local inf = math.huge
local ray = Ray.new

local function getTotalTransparency(part)
	return 1 - (1 - part.Transparency) * (1 - part.LocalTransparencyModifier)
end

local function eraseFromEnd(t, toSize)
	for i = #t, toSize + 1, -1 do
		t[i] = nil
	end
end

local nearPlaneZ, projX, projY
do
	local function updateProjection()
		local fov = rad(camera.FieldOfView)
		local view = camera.ViewportSize
		local ar = view.X / view.Y

		projY = 2 * tan(fov / 2)
		projX = ar * projY
	end

	camera:GetPropertyChangedSignal("FieldOfView"):Connect(updateProjection)
	camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateProjection)

	updateProjection()

	nearPlaneZ = camera.NearPlaneZ
	camera:GetPropertyChangedSignal("NearPlaneZ"):Connect(function()
		nearPlaneZ = camera.NearPlaneZ
	end)
end

local blacklist = {}
do
	local charMap = {}

	local function refreshIgnoreList()
		local n = 1
		blacklist = {}
		for _, character in pairs(charMap) do
			blacklist[n] = character
			n = n + 1
		end
	end

	local function playerAdded(player)
		local function characterAdded(character)
			charMap[player] = character
			refreshIgnoreList()
		end
		local function characterRemoving()
			charMap[player] = nil
			refreshIgnoreList()
		end

		player.CharacterAdded:Connect(characterAdded)
		player.CharacterRemoving:Connect(characterRemoving)
		if player.Character then
			characterAdded(player.Character)
		end
	end

	local function playerRemoving(player)
		charMap[player] = nil
		refreshIgnoreList()
	end

	Players.PlayerAdded:Connect(playerAdded)
	Players.PlayerRemoving:Connect(playerRemoving)

	for _, player in ipairs(Players:GetPlayers()) do
		playerAdded(player)
	end
	refreshIgnoreList()
end
