I'm coding a page system for a character customization GUI so the user can view every element without them all being on-screen at once. This code immediately comes after I set up the bulk of the system.
for _,f in pairs(tsp:GetChildren()) do
for _,f2 in pairs(f:GetChildren()) do
if f.Name == "page1" then
-- f:GetChildren()[table.find(f:GetChildren(),f2,1)].Name
tsc[f2.Name].Visible = true
tsc[f2.Name].BackgroundTransparency = 0
else
tsc[f2.Name].Visible = false
tsc[f2.Name].BackgroundTransparency = 1
end
end
end
When the script reaches here, I get the error Visible cannot be assigned to at tsc[f2.Name].Visible = false, even though there were no issues at all for months until yesterday.
Then hours later, the error occured at tsc[f2.Name].Visible =true, and then an hour later the error went back to occuring at tsc[f2.Name].Visible = false.
The error also only occurs when I set tsc[f2.Name].BackgroundTransparency to 1, but not to 0. There were also no problems with this for months until yesterday.
This is hindering my progress; I saved the script and restarted ROBLOX Studio, I rearranged the code, I even rewrote a simple line to tsc[ f:GetChildren()[table.find(f:GetChildren(),f2,1)].Name ].Visible = true to get the specific name of f2, and the error still occured when set to false, and now when set to true.
Help is greatly appreciated!

3 comments
you are not checking if the object has the property .Visible, therefore, it can and will error if it encounters something that doesn't have .Visible property (i.e. script, uicorner)
say, for example, UICorner.Visible = false
to counter this you could check if it is a Frame or a ScrollingFrame or whatever with :IsA()