What would be the most efficient way to make a durability system

im making a simple system where you can cut down trees. I am using number values for the trees durability and max durability. It will also have a simple gui to show the durability of the tree.

Would having a seperate script inside every tree for both the server and client sided things be more efficient or would it be better to try and run the code for all trees inside a singular script?

also if the latter. How could i do that for all the gui? should i run it with a server script (the game is singleplayer only so it doesnt matter much) or run all the gui stuff in a local script (and if so, where would be the best place to put it?)

Considering it’s a singeplayer game, it would be best to update via client considering OTHER users won’t be in the game to see it and it’d only be visual for that user on client due to it being a ONE PLAYER game. I also don’t think adding a script for EACH tree is optimal, have a central script to work around ALL trees if they’re foldered it’d be MUCH easier to define

noted. ill try smth with collectionservice!

Sounds good and easier considering you don’t have to rely on foldering or manually loop all the time (which can be a PAIN for memory if not done right) and it’s quite scalable from that point.