local ScrollingFrame = nil -- Put the parent of the buttons here instead of nil
local SearchBar = nil -- Put the textbox of your searchbar here instead of nil
local InputText = string.lower(SearchBar.Text)
for _, Button in pairs(ScrollingFrame:GetChildren()) do
if Button:IsA("TextButton") or Button:IsA("ImageButton") then
Button.Visible = string.find(string.lower(Button.Name), InputText) and true or false
It probably works, and it’s not case sensitive
Late edit: (I did some code cleanup)
Each time the text of SearchBar changes, it will iterate through the children of ScrollingFrame:
It checks for each child if they are a TextButton or an ImageButton class.
It then sets the Visible property of the children of which a part of the name matches with the input to true, or else it will set it to false.
(Make sure to use a UIListLayout or UIGridLayout in the ScrollingFrame or else you might get unwanted behaviour such as empty spaces if they are on set positions and have nothing else that orders their new positions.)