Posted 03 March 2012 - 01:38 AM
I'm trying to make a dice program where you choose which die you want based on sides, and then it'll print out the results for you. It is getting a lot of weird errors. This is what I have:
local Y = Y
print("Would you like to roll a die? Y or N: ")
input = read()
if input == Y then
print("What die would you like?")
print("1: 6 sided die")
print("2: 12 sided die")
print("3: 20 sided die")
Input = read()
if x = 1 then
print(math.random(1, 6))
sleep(3)
os.shutdown()
end
if x = 2 then
print(math.random(1, 12))
sleep(3)
os.shutdown()
end
if x = 3 then
print(math.random(1, 20))
sleep(3)
os.shutdown()
end
else
print("Ah, ok. Bye!")
sleep(1)
os.shutdown()
end