I’ve recently had an issue with getting all the properties of objects. (Before you post, No, I don’t want API endpoints or manual-input property tables) - The following is the code I already have:
for index, property in pairs(S2) do --/ Error Occurs Here
print(index)
print(property)
if (S2[property]) then
PTablePerUIObject[S2.Name][property] = S2[property]
end
end
Error states: “invalid argument #1 to ‘pairs’ (table expected, got Instance)”
Note, I assume this issue is because I’m not indexing the instance for something specific, i’m just looking for it there is a way to find specifically the properties of the instance, nothing else. S2 is not meant to be a table.