Im kinda new to metatables and modules so this might be easy or it could be something nothing to do with modules or metatables. When I call InterpretInput
it always prints the exact same thing. Why?
function module.CreateBookTables(pages,author)
--PAGE CONSTRUCT
local pageTable = {}
for i=1,pages do
pageTable[i]={
Display = workspace:WaitForChild("Page1").SurfaceGui.TextBox;
Text = "";
Page = i;
}
end
--DATA CONSTRUCT
local dataTable = {
LastInput = Enum.KeyCode.Unknown;
LastInputTick = tick();
BoldToggle = false;
ItalicToggle = false;
}
--BOOK CONSTRUCT
local bookTable = {
PageTable = pageTable;
DataTable = dataTable;
Author = author;
Title = "";
}
local metaBookTable = setmetatable(bookTable,module)
return metaBookTable
end
function module:InterpretInput(input,gpEvent)
local dataTable = self.DataTable
local lastInput = self.DataTable.LastInput
print(lastInput)
end