Im having a problem regarding with my table. I cant connect the table to my other lua file. I have an error on local lblGiven = display.newText. It displays Error bad argument#-1 newText. The mechanic of this program is if you click the button a single part of the table will display as a label.
this is my file called questions.lua
local M = { { "What is the answer 1", answer = "17", }, { "What is the answer 2", answer = "18", }, { "What is the answer 3", answer = "25", }, }, return M
This is my main.lua
local given = require("questions") local lblGiven = display.newText( { text = given[math.random(#given)], x = 160, y = 310, font = native.systemFont, align = "center" } )