If I have a block part, how could I print a list of it's properties? The result I want would look like:
brickcolor = whatever, color = whatever, material = whatever, reflectance = whatever
I tried the following but it doesn't work because it's an object and not a table:
local part = game.Workspace.part for k, v in pairs(part) do print(k,v) end
The simplest option is to put the list of properties you're interested in into a list, like so:
local properties = {"Color", "Material", "Reflectance",} --etc local function GetPropertiesFromPart(part) -- returns a table you can use 'pairs' on local t = {} for i = 1, #properties do t[properties[i]] = part[properties[i]] end return t end local part = game.Workspace.part for k, v in pairs(GetPropertiesFromPart(part)) do print(k,v) end
The more complicated option is to download the Roblox API dump and parse it to get the list of properties - but you probably don't need to do that.