UI Filter System not working

Okay, so what I am trying is to make a smooth UI opening filter, but this doesn’t seem to work…

Current Code
local Blacklisted = {"Divider", "Panel", "Panel1","BList"}
function FilterV2(Frame: Frame, Value: boolean)
	for _,v in pairs(Frame:GetChildren()) do
		--local Data = Blacklisted[v.Name]
		if not table.find(Blacklisted, v.Name) then
			local SelectedNumber = 1
			wait(.1)

			if Value then SelectedNumber = 0 end
			if HubMain:CheckProperty(v, "Visible") then
				v.Visible = Value
			end

			if v:IsA("ImageButton") or v:IsA("ImageLabel") then
				Tween(v, .5, {ImageTransparency= SelectedNumber}):Play()
			elseif v:IsA("Frame") or v:IsA("Button") then
				Tween(v, .5, {BackgroundTransparency= SelectedNumber}):Play()
			elseif v:IsA("TextLabel") then
				Tween(v, .5, {TextTransparency= SelectedNumber}):Play()
			end
			if #v:GetChildren() >= 1 then
				FilterV2(v, Value)
			end
		end		
	end
	return true
end
Old Working Code
function fadechilds(Frame: Frame, Numb: number)
	for _,v in pairs(Frame:GetChildren()) do
		wait(.01)
		if v:IsA("ImageButton") or v:IsA("ImageLabel") then
			Tween(v, .5, {ImageTransparency= Numb}):Play()
		elseif v:IsA("Frame") or v:IsA("Button") then
			if v.Name ~= "BList" and v.Parent.Name ~= "BList" then
				Tween(v, .5, {BackgroundTransparency= Numb}):Play()
			end
		elseif v:IsA("TextLabel") then
			Tween(v, .5, {TextTransparency= Numb}):Play()
		end
		if #v:GetChildren() > 1 then
			fadechilds(v, Numb)
		end
	end
end

function FilterInstances(Frame: Frame, Value: boolean)
	for _,v in pairs(Frame:GetChildren()) do
		if v.Name ~= "Divider" and v.Name ~= "Panel" and v.Name ~= "BList" then
			if v:IsA("Frame") or v:IsA("ScrollingFrame") then
				v.Visible = Value
				pcall(function()
					if Value then
						fadechilds(v, 0)
					else
						fadechilds(v, 1)
					end
				end)
			end
		end
	end
	return true
end

Any Assistance would be appreciated as I have no clue.

1 Like

what is it supposed to

Names or Text (use textservice),or instances or players?


Something like this, but then with some backgrounds transparent etc, (blacklisted ones)

maybe

local transparency1Names = {['hello']=true}
local transparency0Names = {['i become visible']=true}
for i,v in ipairs(instance:GetChildren())do
    if transparency0Names[v.Name] and not transparency1Names[v.Name]then
        for ii = 1,0,.1 do
            v.BackGroundTransparency = ii
            task.wait()
        end
    end
end

that would not work as i am recursive looping the funtion and it only needs to exclude a number of names.

It fires it like this

FilterV2(Hub.Home.Panels, true)

Are you getting any errors in console?

none. it’s basically not working as intended.

You’re just trying to merge the 2 functions right?

function fadechilds(Frame: Frame, Numb: number)
	for _,v in pairs(Frame:GetChildren()) do
		if v.Name ~= "Divider" and v.Name ~= "Panel" and v.Name ~= "BList" then
			if v:IsA("Frame") or v:IsA("ScrollingFrame") then
				v.Visible = Value
				pcall(function()
					if Value then
						fadechilds(v, 0)
					else
						fadechilds(v, 1)
					end
				end)
			end
		end
		wait(.01)
		if v:IsA("ImageButton") or v:IsA("ImageLabel") then
			Tween(v, .5, {ImageTransparency= Numb}):Play()
		elseif v:IsA("Frame") or v:IsA("Button") then
			if v.Name ~= "BList" and v.Parent.Name ~= "BList" then
				Tween(v, .5, {BackgroundTransparency= Numb}):Play()
			end
		elseif v:IsA("TextLabel") then
			Tween(v, .5, {TextTransparency= Numb}):Play()
		end
		if #v:GetChildren() > 1 then
			fadechilds(v, Numb)
		end
	end
end

ins’t roblox like down rn? why are we talking about code if we can’t test it?

This would be inefficient, i’m basically trying to improvise and reducing the amount of lines I’m using.

Maybe for you. I’m one of few still in Studio.

how did you did that? you left your PC ON all night?

Can you check your private messages?

function fadechilds(Frame: Frame, Numb: number)
	for _, v in pairs(Frame:GetChildren()) do
		if v:IsA("Frame") or v:IsA("Button") or v:IsA("ScrollingFrame") then
			if v.Name ~= "BList" and v.Parent.Name ~= "BList" then
				Tween(v, .5, {BackgroundTransparency= Numb}):Play()
				v.Visible = Value
				pcall(function()
					if Value then
						fadechilds(v, 0)
					else
						fadechilds(v, 1)
					end
				end)
			end
		elseif v:IsA("TextLabel") then
			Tween(v, .5, {TextTransparency= Numb}):Play()
		elseif v:IsA("ImageButton") or v:IsA("ImageLabel") then
			Tween(v, .5, {ImageTransparency= Numb}):Play()
		end
		if #v:GetChildren() > 1 then
			fadechilds(v, Numb)
		end
	end
end

YOU ARE A WIZARD HARRY.
(pls don’t sue me harry potter owner this was just a joke don’t find my location)

is Tween() a function? 30 hcaracters

Its not actually. Its API ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

I know that its just hes calling it without a .new or :create thats why I asked. because he might of made it a function

function Tween(Obj: any, Time: number, data: any)
	local Data = TweenService:Create(Obj, TweenInfo.new(Time, Enum.EasingStyle.Quint), data)
	return Data
end