local r={}for i,j in pairs(gunmodel:GetDescendants())do if j:IsA("\066\097\115\101\080\097\114\116")then table.insert(r,j)end end function guntransparency(i)for r,j in pairs(r)do j.LocalTransparencyModifier=i end end function modeltransparency(r,i)for r,j in pairs(r:GetDescendants())do if j:IsA("\066\097\115\101\080\097\114\116")then j.LocalTransparencyModifier=i end end end
--gun parts
local gunparts = {}

for i, v in pairs(gunmodel:GetDescendants()) do
	if v:IsA("BasePart") then
		table.insert(gunparts, v)
	end
end

function guntransparency(tr)
	for i, v in pairs(gunparts) do --looping through an already made table alone is faster than getdescendants and then looping
		v.LocalTransparencyModifier = tr
	end
end

function modeltransparency(m, tr) -- this is for stuff like fps mags
	for i, v in pairs(m:GetDescendants()) do
		if v:IsA("BasePart") then
			v.LocalTransparencyModifier = tr
		end
	end
end
