Reactor_Games

Untitled

Jan 6th, 2021 (edited)
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local random = 0;
  2. local event = require("event")
  3. local component = require('component')
  4. local term = require("term")
  5. local m = component.modem
  6.  
  7. while true do
  8.     e = {event.pull('magData')}
  9.     b = e[4]
  10.     if b == "Lucky" then
  11.         random = math.random (1, 9)
  12.             if random == 1 then
  13.                 print(random)
  14.                 m.broadcast(51, "1")
  15.         elseif random == 2 then
  16.                 print(random)
  17.                 m.broadcast(51, "2")
  18.         elseif random == 3 then
  19.                 print(random)
  20.                 m.broadcast(51, "3")
  21.         elseif random == 4 then
  22.                 print(random)
  23.                 m.broadcast(51, "4")
  24.         elseif random == 5 then
  25.                 print(random)
  26.                 m.broadcast(51, "5")
  27.         elseif random == 6 then
  28.                 print(random)
  29.                 m.broadcast(51, "6")
  30.         elseif random == 7 then
  31.                 print(random)
  32.                 m.broadcast(51, "7")
  33.         elseif random == 8 then
  34.                 print(random)
  35.                 m.broadcast(51, "8")
  36.         elseif random == 9 then
  37.                 print(random)
  38.                 m.broadcast(51, "9")
  39.         end
  40.     else
  41.         term.write("Error")
  42.     end
  43. end
Add Comment
Please, Sign In to add comment