Advertisement
Blackhome

interact

Apr 6th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local uid = 13
  2. rednet.open("top")
  3. -- tuer
  4. local pass = "passwort"
  5. local close = "zu"
  6.  
  7. local id, mess = rednet.receive()
  8. if id == uid and mess == pass then
  9.     redstone.setOutput("right", true)
  10.     rednet.send(id, "die Tuer ist nun offen!")
  11.     local b = 1
  12.     while b == 1 do
  13.         id, mess = rednet.receive()
  14.         if id == uid and mess == close then
  15.             b = 0
  16.             redstone.setOutput("right", false)
  17.             rednet.send(id, "1")
  18.         elseif mess ~= close then
  19.             rednet.send(id, "2")
  20.         end
  21.     end
  22. elseif id ~= uid then
  23.     rednet.send(id, "Sie haben nicht die Befugnis!")
  24. else
  25.     rednet.send(id,"falsches Passwort")
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement