Using OOP in a module script i fire another module script with a variable like this:
Module[MyVariable]()
The variable is named the same as a function in the Module. A problem occurs when i try and reference the variable self which should be the metatable thingy since i used a method like this
function Object:MyMethod()
but when i try and print self, it returns nil. this doesn’t happen if i reference the method in this way
Module:MyMethod()
I thought of a way around it but i didn’t do it since i feel it is sloppy, also i havent even tried it so idk if it 100% even works, wouldn’t wanna do it that way anyways. What is the best way around this?
That’s how you would do it. When you write a function like function Object:MyMethod() it cuts out the first argument and assumes that “self” is the first.