Script:
wait(5)
local Search = script.Parent
local Cmds = script.Parent.Parent.Cmds
local InResearves = {
}
Search:GetPropertyChangedSignal("Text"):Connect(function()
if Search.Text == "Search" or Search.Text == "" or Search.Text == nil or #Search.Text == 0 then
print("Search")
for i,v in pairs(InResearves) do
v.Parent = Cmds
table.remove(InResearves,i)
end
else
print(Search.Text)
for i,v in pairs(Cmds:GetChildren()) do
if v:IsA("TextLabel") then
if string.sub(v.Name,0,#Search.Text) ~= Search.Text then
print(v.Name.." ~= "..Search.Text)
table.insert(InResearves,v:Clone())
v:Destroy()
else
print(v.Name.." == "..Search.Text)
end
end
end
end
end)
it doesn't put all the commands back into the gui when the text of Search is nothing

1 comment
Remove the call to wait a line 1, now. You don't need it at all.