Is this good practice?


I feel like dropping hundreds of attributes onto the humanoid probably isn’t. Before you ask, yes all of these stats are necessary.

It shouldn’t lag or cause any problems. It’s just values. But if your more worried about organization then that’s another thing.

But maybe you could put some of those in scripts as script variables instead of physical attributes.

I prefer to have a folder under the NPC and have all the variables under that folder instead of all the attributes in the humanoid. Because what if you have multiple NPCs? And you add another attribute? But whatever suits you.

Good practice in terms of memory yes, but organization I don’t know, good practice if it seems comfortable and functional to you, it is also good practice in visual terms.

Personally, I like OOP better

--		Module		--
local Methods = {}



--		Constructor		--
local Storage = {}
return function(Rig: Model)
	if Storage[Rig] then		return Storage[Rig]		end
	
	--		new		--
	local self = table.clone(Methods)
	self.Limits = {
		--something
	}
	self.Levels = {
		--something
	}
	
	--		Storage		--
	Storage[Rig] = self
	return self
end

summary: a table that stores information, you can add methods that apply to that object and store more complex values ​​(table with values, instances)

and this should maybe be in code review

1 Like