Tagged components
Attach reusable behaviour to Roblox instances using CollectionService.
Try the component starter#
Add Tagged components. In Studio, create a Part and tag it BloxgColourPad. During play, touching it with a character changes the part’s colour. The script attaches to both existing tagged instances and ones added later.
Clean up the lifecycle#
Keep connections associated with each instance. When a tag is removed, disconnect listeners and release per-instance state. Avoid attaching the same behaviour twice. For temporary effects, also clean up spawned instances and running tasks.
Build your own components#
Use tags for behaviours such as doors, pickup points or hazards. Keep configuration in attributes and put authority on the server. This is a small original starter, not a full entity-component framework or an automatic importer of a competitor’s components.