How to find table in a table?

Textbox to answer the questions

Try using tonumber() to convert the string into a number.

Then it would be nil. I admit the variable is kind of misleading, but it is basically the question. AKA: “Name an US President”

So when the Player Stops using the TextBox, it will Fire

script.Parent.FocusLost:Connect(function()
	Event:FireServer(script.Parent.Text)
end)

So when looking for the item, it will look for the Matching answer

if table.find(data[questionnum].answers, answer) then
1 Like

Try this function, if it returns true, the player had the correct answer:

local function CheckAnswer()
	for i, v in pairs(data) do
		if v.question == Status.Value then
			for i, x in pairs(v.answers) do
				if answer == x then
					print(answer.."True")
					return true
				end
			end
		end
	end
end
1 Like

That is what I already have, it says attempt to index nil with answers

Now, I can’t give U solution sadly since the topics title was already solved by cairo. However, I can do say it works! Thanks so much.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.