Not the complete code, but this script shouldn't be destroying the objects named "Scrollbar" and "Title" but it's doing it anyway.
for i, v in pairs(Objects:GetChildren()) do if ((v.Name ~= "Scrollbar") or (v.Name ~= "Title")) then v:Destroy() print("Destroyed: " .. v.Name) end end
Output: Destroyed: Scrollbar Destroyed: Title
Every name is either "not Scrollbar" or "not Title".
You mean and
: it must be neither Scrollbar nor "Title".
Another way to think of it:
if v.Name == "Scrollbar" or v.Name == "Title" then -- I want to keep it else -- I want to delete it end
To flip that, you can add a not ( ...
to the whole condition:
if not (v.Name == "Scrollbar" or v.Name == "Title") then
De Morgan's laws tells us this is:
if v.Name ~= "Scrollbar" and v.Name ~= "Title" then