Skip to content

Roblox Typescript package for using type-safe attributes.

License

Notifications You must be signed in to change notification settings

hero-ku/attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Attributes

Attributes is a Roblox Typescript package for using type-safe attributes.

npm install @rbxts/attributes

Usage

Types

These are the types supported by Roblox attributes. String Boolean Number UDim UDim2 BrickColor Color3 Vector2 Vector3 NumberSequence ColorSequence NumberRange Rect

Using Attributes

To create your object of attributes, invoke the Attributes function with the instance and the attribute types. From there, simply assign to or reference your attributes to get or set them.

const MyPart = new Instance("Part");
const PartData = Attributes<{ Message: string }>(MyPart);

PartData.Message = "Hello World!";
print(PrintData.Message);

About

Roblox Typescript package for using type-safe attributes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published