Hello there!
I’m quite new to coding in general, but I’m trying to build a multiple-choice question game.
What I want to do currently is have the current selection deselected when another selection is made, or when the current selection is tapped again.
To do this, I’ve made two variables to keep track of the number of taps on a selection, and the last selection made.
I want both of these variables to be evaluated in an If/Then/Else statement.
This is the part of the code I’ve come up with to do this:
local function selectionOne() if (touchCount == 0) then touchCount = touchCount + 1 selectionIdentifier = "a" --make Selection One highlight elseif (touchCount \>= 1 and selectionIdentifier = "a") then --remove Selection One's highlight touchCount = 0 elseif (touchCount \>= 1 and selectionIdentifier = "b") then --remove Selection Two's highlight --make Selection One highlight touchCount = 0 end end
I’ve being using the ‘and’ operator to try and make the if/else statement do this, but I keep running into an error on Line 6 – ‘)’ expected near ‘=’
I assume this means that the program is being evaluated as if there’s an illegal statement that it’s ignoring.
So, is it possible for multiple conditions to have to be met in order to trigger an if/else/then statement? What am I doing wrong?
Thanks in advance.