I’m trying to activate a function in a module by connecting to when the player hits an input. When I trigger InterpretInput, self prints as this through the module:
How do you make the variable bookConstructor? Like the function for the returned table.
Also just to make sure self is understood, self just is always the table that the function was called on. So in this case it’s going to be bookConstructor no matter if you overwrote a variable called self elsewhere.
This probably isnt exactly how it works, but its something along the lines.
Basically any function that is in a table sets self to the table the parent is in.
Im not sure if there is a work around for it, so in the meantime dont use self
You’re invoking a method of the class on the class itself, not an instance of the class. Make sure you’re calling “InterpretInput” on what’s returned by module.CreateBookTables. To help clarify the problem:
-- What you should be doing
local instance = Class.new()
instance:Method()
-- Vs.
-- What you are doing:
local instance = Class.new()
Class:Method()