Kartik Scripts

GetPropertyById

exports['kartik-properties']:GetPropertyById(id)

๐Ÿ”น Description

Returns a single property as a normalised shaped property record, or nil if no property with that id exists.


๐Ÿ”ง Parameters

NameTypeRequiredDescription
idnumber | stringโœ…The property id.

๐Ÿ“ค Returns

TypeDescription
tableThe shaped property record.
nilIf no property exists with the given id.

๐Ÿง  Example Usage

local p = exports['kartik-properties']:GetPropertyById(42)
if p then
    print(('#%d %s owned by %s'):format(p.id, p.label, p.ownerName))
end

๐Ÿ“Œ Notes

  • The id is coerced to an integer, so both 42 and "42" are accepted.

On this page