math.randomseed(os.time())
dice = math.random(1, 5)
function testFunction()
if (dice == 1) then
print("dice = 1")
elseif (dice == 2) then
print("dice = 2")
elseif (dice == 3) then
print("dice = 3")
elseif (dice == 4) then
print("dice = 4")
elseif (dice == 5) then
print("dice = 5")
elseif (dice == 6) then
print("dice = 6")
else
print("invalid")
end
end
testFunction()
-----------------
testTable = {}
testTable[1] = {
dice = 1,
dice = 2
}
testTable[2] = {
dice = 3,
dice = 4
}
testTable[3] = {
dice = 5,
dice = 6
}
local roll = testTable[currentRoll]
function testFunction2()
if roll ~= testTable[3] then
print("current roll is", dice)
elseif dice == testTable(3) then
print("win")
else
print(nil)
end
end
testFunction2()
To embed this program on your website, copy the following code and paste it into your website's HTML: