local b=game:GetService("\080\108\097\121\101\114\115")local y=game.Workspace.CurrentCamera local V=math.min local S=math.tan local X=math.rad local U=math.huge local G=Ray.new local function L(b)return 1-(1-b.Transparency)*(1-b.LocalTransparencyModifier)end local function D(b,y)for y=#b,y+1,-1 do b[y]=nil end end local g,F,E do local function b()local b=X(y.FieldOfView)local V=y.ViewportSize local U=V.X/V.Y E=2*S(b/2)F=U*E end;(y:GetPropertyChangedSignal("\070\105\101\108\100\079\102\086\105\101\119")):Connect(b);(y:GetPropertyChangedSignal("\086\105\101\119\112\111\114\116\083\105\122\101")):Connect(b)b()g=y.NearPlaneZ;(y:GetPropertyChangedSignal("\078\101\097\114\080\108\097\110\101\090")):Connect(function()g=y.NearPlaneZ end)end local k={}do local y={}local function V()local b=1 k={}for y,V in pairs(y)do k[b]=V b=b+1 end end local function S(b)local function S(S)y[b]=S V()end local function X()y[b]=nil V()end b.CharacterAdded:Connect(S)b.CharacterRemoving:Connect(X)if b.Character then S(b.Character)end end local function X(b)y[b]=nil V()end b.PlayerAdded:Connect(S)b.PlayerRemoving:Connect(X)for b,y in ipairs(b:GetPlayers())do S(y)end V()end
--!nonstrict
--------------------------------------------------------------------------------
-- Popper.lua
-- Prevents your camera from clipping through walls.
--------------------------------------------------------------------------------

local Players = game:GetService("Players")

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
