Most effective handler for tycoon buttons

I have a bunch of buttons in the tycoon game I’m making and essentially I have scripts for each individual button but do not wish to rewrite code over and over again in each and every button script if I need to add more attributes or fix bugs. What’s the most effective way to create a “one script all buttons” situation for this?

1 Like

Use collection service and object values. Tag each button with a button tag, loop through all the objects with the tag, connect the touched function, where you look for a value to indicate what it’s supposed to build.

1 Like