Advertisement
AEAEAEAEarray

TNT Stick spam

Sep 15th, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const send = MPP.chat.send;
  2. var playing = false;
  3. var play = confirm("Are you sure want to start 'TNT Strick Spam' Midi");
  4. if (!play) {
  5.     alert("Cancelled");
  6. } else {
  7.     alert("Started Playing | use '/stop' to stop");
  8.     send("Now playing 'TNT Stick Spam'");
  9.     start();
  10. }
  11.  
  12. function start() {
  13.     var s1 = setInterval(function () {MPP.press("a-1");}, 100); setInterval(function () {MPP.press("a3");}, 100); setInterval(function () {MPP.press("a-2");}, 100);                            
  14.     var s2 = setInterval(function () {Object.keys(MPP.piano.keys).forEach((key)=>{MPP.press(key);});}, 900);
  15.     playing = true;
  16. }
  17.  
  18. function stop() {
  19.     clearInterval(s1);
  20.     clearInterval(s2);
  21.     send("Stopped playing 'TNT Stick spam'");
  22.     playing = false;
  23. }
  24.  
  25. MPP.client.on('a', function msg() {
  26.     if (msg.a.startsWith("/play") && !playing) return start();
  27.     if (msg.a.startsWith("/stop") && playing) return stop();
  28. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement