So I have a simple NPC. I just want to know what values should be managed by the metatables since I have some values that I initially set to the character but I’m not sure if those characterattributes will be better stored in self.
BaseNPC.CharacterAttributes = {
["Target"] = nil;
["Stunned"] = false;
["StopDistance"] = 5;
["AttackDistance"] = 7;
["CanAttack"] = true;
["AttackCoolDown"] = 0.7;
}
BaseNPC.__index = BaseNPC
--Helper functions
--Functions
function BaseNPC.new(Cframe, Wave)
local self = setmetatable({}, BaseNPC)
self._Model = Properties.model:Clone()
self._Humanoid = self._Model.Humanoid or self._Model:FindFirstChild("Humanoid")
self._Animator = self._Humanoid:FindFirstChild("Animator")
self._Health = Properties.health * (1 + (HealthScale * Wave))
self._Damage = Properties.damage * (1 + (DamageScale * Wave))
self._Gold = Properties.gold * (1 + (GoldScale * Wave))
self._Experience = Properties.experience * (1 + (ExperienceScale * Wave))
self._WalkSpeed = Properties.speed
self._Cframe = Cframe or CFrame.new()
self._Connections = {}
self:Init()
return self
end