Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function waitForGolem(rsSide, lenght)
- local sleeping = true
- while sleeping do
- --waiting for redstone on
- local waiting = true
- while waiting do
- if rs.getInput(rsSide) then
- waiting = false
- else
- os.pullEvent("redstone")
- end
- end
- --waiting for timer or redstone off
- local waiting = true
- local id = os.startTimer(lenght)
- while waiting do
- local event, param = os.pullEvent()
- if event == "timer" and param == id then
- waiting = false
- sleeping = false
- elseif event == "redstone" and not rs.getInput(rsSide) then
- waiting = false
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment