Posted 16 April 2012 - 07:41 AM
Im getting a error when i run this program
there will be alot more like 1-64
while true do
os.sleep(.5)
number = math.random(1,16)
print (number)
if number == "1" then
rs.setBundledOutput("back", colors.white)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.white)
end
if number == "2" then
rs.setBundledOutput("back", colors.orange)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.orange)
end
if number == "3" then
rs.setBundledOutput("back", colors.magenta)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.magenta)
end
if number == "4" then
rs.setBundledOutput("back", colors.lightblue)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.lightblue)
end
if number == "5" then
rs.setBundledOutput("back", colors.yellow)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.yellow)
end
if number == "6" then
rs.setBundledOutput("back", colors.lime)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.lime)
end
if number == "7" then
rs.setBundledOutput("back", colors.pink)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.pink)
end
if number == "8" then
rs.setBundledOutput("back", colors.gray)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.gray)
end
if number == "9" then
rs.setBundledOutput("back", colors.lightgray)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.lightgray)
end
if number == "10" then
rs.setBundledOutput("back", colors.cyan)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.cyan)
end
if number == "11" then
rs.setBundledOutput("back", colors.purple)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.purple)
end
if number == "12" then
rs.setBundledOutput("back", colors.blue)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.blue)
end
if number == "13" then
rs.setBundledOutput("back", colors.brown)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.brown)
end
if number == "14" then
rs.setBundledOutput("back", colors.green)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.green)
end
if number == "15" then
rs.setBundledOutput("back", colors.red)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.red)
end
if number == "16" then
rs.setBundledOutput("back", colors.black)
os.sleep(.5)
rs.setBundledOutput("back", rs.getBundledOutput("back") - colors.black)
end
end
im kind of new but its my first time doing a number generatorthere will be alot more like 1-64