Advertisement
RabaGhast

SpawnerAlarm

Sep 24th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. alarmed = false
  2. inSignal = "left"
  3. outSound = "right"
  4. outLight =  "back"
  5. while true do
  6.   if rs.getInput(inSignal, true) then
  7.     if alarmed == false then
  8.   --  print("Alarm")
  9.       rs.setOutput(outSound, true)
  10.       rs.setOutput(outLight, true)
  11.       alarmed = true
  12.       sleep(1.8)
  13.     else
  14.   --  print("Alarm already sounded")
  15.       rs.setOutput(outSound, false)
  16.       rs.setOutput(outLight, true)
  17.     end
  18.   else
  19.     -- print("No alarm")
  20.     rs.setOutput(outSound, false)
  21.     rs.setOutput(outLight, false)
  22.     alarmed = false
  23.   end
  24.   sleep(1)
  25. end
  26. --RabaGhast
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement