attribute_utils
this module provides utilities for working with attributes in kit objects.
Types
string_data
interface string_data {enums: {string}?--
the different options the attribute can take. if not provided, the attribute can take any string value.
default: string--
the default value of the attribute.
__type: "string"--
the type of the attribute. this will always be "string".
}represents a string attribute.
number_data
interface number_data {min: number?--
the minimum value the attribute can take. if not provided, the attribute can take any number value.
max: number?--
the maximum value the attribute can take. if not provided, the attribute can take any number value.
default: number--
the default value of the attribute.
__type: "number"--
the type of the attribute. this will always be "number".
}represents a number attribute.
boolean_data
interface boolean_data {default: boolean--
the default value of the attribute.
__type: "boolean"--
the type of the attribute. this will always be "boolean".
}represents a boolean attribute.
cframe_data
interface cframe_data {__type: "cframe"--
the type of the attribute. this will always be "cframe".
}represents a cframe attribute.
Functions
get
attribute_utils.get() → {[string]: any}--
the attributes for the object.
get all attributes for an object.
attributes.string
attribute_utils.attributes.string(data: {enums: {string}?,default: string}--
the attribute data.
) → string_data--
the actual attribute data, used by the "get" function.
create a new string attribute.
attributes.number
attribute_utils.attributes.number(data: {min: number?,max: number?,default: number}--
the attribute data.
) → number_data--
the actual attribute data, used by the "get" function.
create a new number attribute.
attributes.boolean
attribute_utils.attributes.boolean(data: {default: boolean}--
the attribute data.
) → boolean_data--
the actual attribute data, used by the "get" function.
create a new boolean attribute.
attributes.cframe
attribute_utils.attributes.cframe() → cframe_data--
the actual attribute data, used by the "get" function.
create a new cframe attribute.