I was experimenting with Search GUI's and came up with this, now I was wondering if someone can tell me what I am doing wrong with it as to why it's only working if I type the full text? I want it to be visible if I type stuff like C and there's a frame named Cow.
Here's what I tried:
local frame = script.Parent.Parent.ScrollingFrame script.Parent.Changed:connect(function() for _,v in pairs(frame:GetChildren()) do if string.find(script.Parent.Text,v.Name) then v.Visible = true else v.Visible = false end end end)
How would I make it work if I typed stuff like "C"?
Any help appreciated.
Sorry I can't explain any better.
This works if there is everything in one parent:
local text = "c" text = text:lower() -- to avoid stuff ups local children = script.Parent.Frame:GetChildren() function check() for _,v in pairs (children) do local s = text:len() local find = v.Name:sub(1,s) find = find:lower() if find == text then return v end end end check()
SORRY, ANOTHER ERROR I MADE I have fixed it :/ local s = text:len()
, not v.Name:len()
. It works now.
Hope I helped :)