Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ToggleReciever
- rednet.open("bottom")
- local mottafra = 0
- local output = "back"
- local state = 0
- function toggleOutput()
- id, msg = rednet.receive()
- print("")
- print("Fra "..id)
- print(msg)
- if id == mottafra and msg == "Spawner_ZombiePToggle" and state == 0 then
- print("Spawner er på!")
- rs.setOutput(output, true)
- state = state + 1
- print(state)
- elseif id == mottafra and msg == "Spawner_ZombiePToggle" and state == 1 then
- print("Spawner er av!")
- rs.setOutput(output, false)
- state = state - 1
- print(state)
- end
- end
- while true do
- toggleOutput()
- end
Add Comment
Please, Sign In to add comment