Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The function
- function redstoneSound(note,instrument)
- if note > 23 then
- return printError("You can't have more than 23 notes on 1 instrument !\n(Notes are going from 0 to 23)")
- end
- if instrument > 5 then
- return printError("There is no more than 5 instruments !")
- end
- redstone.setAnalogOutput("bottom",0)
- instrument = instrument - 1
- if note > 15 then
- notePlus = note - 16
- redstone.setAnalogOutput("top",notePlus)
- redstone.setAnalogOutput("left",15)
- else
- redstone.setAnalogOutput("left",note)
- end
- redstone.setAnalogOutput("back",instrument)
- redstone.setAnalogOutput("bottom",1)
- sleep(0.1)
- redstone.setAnalogOutput("top",0)
- redstone.setAnalogOutput("left",0)
- redstone.setAnalogOutput("back",0)
- redstone.setAnalogOutput("bottom",0)
- end
- --
- --Exemple command: redstoneSound(10,5) is going to play the note #10 with the fifth instrument
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement