When designing my classes, they often need further modularisation, and as such I end up doing things like this:
local DealDamage = require(script.DealDamage) function Sword:DealDamage(damage, target) DealDamage(self, damage, target) end
I find this fairly ineloquent and thought there was probably a better way, but I can’t think of what it is. I also tried
Sword.DealDamage = require(script.DealDamage)
but the problem with this is that I obviously can’t access self in DealDamage. I could do something like
Sword.DealDamage = require(script.DealDamage)(self)
and inject it in as I’m currently doing, but that’ll make the code in DealDamage quite messy.
Anyone have any ideas?