#help
7 messages · Page 1 of 1 (latest)
local textBox = script.Parent.SearchBar -- CHANGE THIS TO YOUR TEXT BOX
textBox.Changed:Connect(function() -- when the text is changed
local text = textBox.Text:lower() -- lowercase search bar text
if text ~= "" then -- if it has text
local buttons = scroll:GetDescendants() -- all of the buttons
for _, button in pairs(buttons) do -- loops through the buttons
if button:IsA("Frame") then -- if it's a button
local buttonText = button.CarName.Text:lower() -- lowercase button text
if string.find(buttonText, text) then -- if search bar text is found in the button's text
button.Visible = true -- shows button
else -- otherwise
button.Visible = false -- hides button
end
end
end
else -- if it's empty
local buttons = scroll:GetDescendants() -- all buttons
for _, button in pairs(buttons) do -- loops through buttons
if button:IsA("Frame") then -- if it's a button
button.Visible = true -- shows button
end
end
end
end)
i named everything correct ig
(ig i found solution)
nvm i didnt
found solution now