Test for a property

@Meisrcool An exception of “TextureId” is not a valid member" will be thrown for nonexistent members. Always.

@ OP you will unfortunately have to write your own function to determine this.

local function instance_has_property(instance, property)
    local has_property, data = pcall(function()
        return instance[property]
    end)

    return has_property and not instance:FindFirstChild(property) and typeof(data) ~= "RBXScriptSignal" and typeof(data) ~= "function"
end
1 Like