Here is some of my code:Error
Syntax error: main.lua:101: 'then' expected near ','
Traceback
[C]: ?
[C]: in function 'require'
[C]: in function 'xpcall'
Code: Select all
function love.load()
genA, genB = math.random(1, 1028), math.random(1, 768)
genTLX, genTLY = genA - 100, genB - 100
genTMX, genTMY = genA, genB - 100
genTRX, genTRY = genA + 100, genB - 100
genMLX, genMLY = genA - 100, genB
genMRX, genMRY = genA + 100, genB
genBLX, genBLY = genA - 100, genB + 100
genBMX, genBMY = genA, genB + 100
genBRX, genBRY = genA + 100, genB + 100
tiles.floor2 = {}
genX = math.random(1, 3)
genY = math.random(1, 3)
if genX, genY = (1, 1) then -- This is the affected line. Line 101.
genTLX, genTLY = genTLX, genTLY
elseif genX, genY == (1, 2) then
genTMX, genTMY = genTMX, genTMY
elseif genX, genY == (1, 3) then
genTRX, genTRY = genTRX, genTRY
elseif genX, genY == (2, 1) then
genMLX, genMLY = genMLX, genMLY
elseif genX, genY == (2, 2) then
genMRX, genMRY = genMRX, genMRY
elseif genX, genY == (2, 3) then
genBLX, genBLY = genBLX, genBLY
elseif genX, genY == (3, 1) then
genBMX, genBMR = genBMX, genBMY
elseif genX, genY == (3, 2) then
genBRX, genBRY = genBRX, genBRY
elseif genX, genY == (3, 3) then
genZ = math.random(1, 8)
if genZ == (1) then
genTLX, genTLY = genTLX, genTLY
elseif genZ == (2) then
genTMX, genTMY = genTMX, genTMY
elseif genZ == (3) then
genTRX, genTRY = genTRX, genTRY
elseif genZ == (4) then
genMLX, genMLY = genMLX, genMLY
elseif genZ == (5) then
genMRX, genMRY = genMRX, genMRY
elseif genZ == (6) then
genBLX, genBLY = genBLX, genBLY
elseif genZ == (7) then
genBMX, genBMR = genBMX, genBMY
elseif genZ == (8) then
genBRX, genBRY = genBRX, genBRY
end
end
end
I would very much appreciate it if somebody could help me fix this.