table:
local questionlist1 = {
question10 = {
text = "What is your username";
speed = .1;
answer = 1;
answertext1 = player.Name;
answertext2 = string.lower(player.Name);
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question11 = {
text = "What is your account age";
speed = .1;
answer = 2;
answertext1 = tostring(player.AccountAge - 1);
answertext2 = tostring(player.AccountAge);
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question12 = {
text = "What is the name of this game";
speed = .1;
answer = 2;
answertext1 = "the test.";
answertext2 = "The test.";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question13 = {
text = "What is the creator of this game";
speed = .1;
answer = 1;
answertext1 = "karbis";
answertext2 = "Karbis";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question14 = {
text = "What is 3^3 + 1592 + 3295?";
speed = .1;
answer = 2;
answertext1 = "4614";
answertext2 = "4914";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question15 = {
text = "What is the square root of 9 + 1912 - 1842";
speed = .1;
answer = 2;
answertext1 = "63";
answertext2 = "73";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question16 = {
text = "What is 44% of 22 x 1392 x 9";
speed = .1;
answer = 1;
answertext1 = "121271.04";
answertext2 = "91271.04";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
question17 = {
text = "1281 - 1823 / 1928 /(:) 8";
speed = .1;
answer = 2;
answertext1 = "903.88180757";
answertext2 = "1280.88180757";
successtext = "Correct!";
failtext = "Wrong.";
successeventfunction = function() learnedquestionsansweredright = learnedquestionsansweredright + 1 end;
faileventfunction = function() end;
};
}
thing that im trying to make it randomly pick:
local questionpicked = questionlist[math.random(1,#questionlist)]

1 comment
The math.random(1, #tbl) works to get a random element from ARRAY part of a table.