Hello. I ran into this issue while scripting, anyone know what this could mean? The output gives me the error “IsA is not a valid member of Color3” when I run the following code:
while true do
for i, v in pairs(parts) do
if v:IsA("Part") then
Tween2:Play()
end
end
end
I am not using any Color properties in my code, just a part transparency tween. Why would this error show up?
Are you ever appending to the table after calling :GetDescendants? If parts is just an array of instances it shouldn’t error when you call :IsA on it.
As a last resort if nobody else chimes in and you can’t find the source, you can try something like if typeof(v) == 'Instance' and v:IsA('BasePart') then, or you could try iterating over the parts table and remove any members that aren’t Instances after populating it.
you could always do
“if typeof(v) == “Instance” and v:IsA(“Part”) then”
to avoid this error. But I recommend finding a reason a color3 would be put into that table since thats not intended by you.
Edit: Oops didnt notice above reply said the same thing.
I decided to simplify it a little and added the line you suggested, resulting in the following:
Script:
local parts = script.Parent:GetDescendants()
for i, v in pairs(parts) do
if v:IsA("Part") then
if typeof(v) == 'Instance' and v:IsA('Part') then
v.Transparency = 1
end
end
end