Rain_Effect

CustomPraticleWings[1.12.2] v1.0

Sep 2nd, 2019
625
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Wings refresh delay, 0 is every tick.
  2. var pi = 0;
  3.  
  4. function keyPressed(e){
  5.     //When player click "~" key
  6.     if(e.key==41){
  7.         //If it have been started
  8.         if(e.player.timers.has(91)){
  9.             //Stop it
  10.             e.player.timers.reset(91);
  11.             e.player.timers.stop(91);
  12.         }else{
  13.             //Start it
  14.             e.player.timers.forceStart(91,pi,true);
  15.         }
  16.     }
  17. }
  18.  
  19. function timer(e){
  20.     if(e.id==91){
  21.         var p = e.player;
  22.         //Set wings
  23.         var w = wing[0];
  24.         //Traversing the wings of the particles corresponds to each row
  25.         for(var i = 1;i<w.line.length+1;i++){
  26.             //Traversing the particle's specified row of particles corresponding to the search word
  27.             for(var j = 0;j<w.line[w.line.length-i].split(",").length;j++){
  28.                 //Traverse particle entries
  29.                 for(var k = 0;k<w.particle.length;k++){
  30.                     //If the current particle search word is the corresponding entry search word
  31.                     if(w.line[w.line.length-i].split(",")[j]==w.particle[k].name){
  32.                         //Generate left wing
  33.                         p.world.spawnParticle(w.particle[k].type, p.x+(w.setting.distanceFromPlayer+w.setting.distanceBetweenParticles*j)*Math.sin((e.player.getRotation()+45)*3.14/180), p.y+(w.setting.startingY+(w.setting.distanceBetweenY*i)), p.z-(w.setting.distanceFromPlayer+w.setting.distanceBetweenParticles*j)*Math.cos((e.player.getRotation()+45)*3.14/180), 0, 0, 0, 0, 1);
  34.                         //Generate right wing
  35.                         p.world.spawnParticle(w.particle[k].type, p.x+(w.setting.distanceFromPlayer+w.setting.distanceBetweenParticles*j)*Math.sin((e.player.getRotation()-45)*3.14/180), p.y+(w.setting.startingY+(w.setting.distanceBetweenY*i)), p.z-(w.setting.distanceFromPlayer+w.setting.distanceBetweenParticles*j)*Math.cos((e.player.getRotation()-45)*3.14/180), 0, 0, 0, 0, 1);
  36.                     }
  37.                 }
  38.             }
  39.         }
  40.     }
  41. }
  42.  
  43. //Wings list
  44. var wing = [
  45.     {
  46.         //Wings name
  47.         name: "Angel Wings",
  48.         //Wings setting
  49.         setting:{
  50.             //The starting height of the wing
  51.             startingY: -0.2,
  52.             //The starting distance from the player
  53.             distanceFromPlayer: 0.2,
  54.             //The distance between each particle in the vertical direction.
  55.             distanceBetweenY: 0.1,
  56.             //The distance between each particle in the horizonal direction.
  57.             distanceBetweenParticles: 0.08
  58.         },
  59.         //The ID of the particle used as a character in the line
  60.         particle:[
  61.             {
  62.                 //Praticle character
  63.                 name: "x" ,
  64.                 //Praticle name
  65.                 type: "enchantmenttable"
  66.             },
  67.         ],
  68.         //The grid layout of the wing. use an '-' to not spawn a particle
  69.         line:[
  70.             "-,-,-,-,x,x,x,-,-,-",
  71.             "-,-,-,x,x,x,x,x,-,-",
  72.             "-,-,x,x,x,x,x,x,x,-",
  73.             "-,x,x,x,x,x,x,x,x,-",
  74.             "x,x,x,x,x,x,x,x,x,x",
  75.             "x,x,x,x,x,x,x,x,x,x",
  76.             "x,x,x,x,x,x,x,x,x,x",
  77.             "x,x,x,x,x,x,x,x,x,x",
  78.             "-,-,x,x,x,x,x,x,x,x",
  79.             "-,-,-,x,x,x,x,x,x,x",
  80.             "-,-,-,x,x,x,x,x,x,x",
  81.             "-,-,-,-,x,x,x,x,x,x",
  82.             "-,-,-,-,x,x,x,x,x,x",
  83.             "-,-,-,-,-,x,x,x,x,-",
  84.             "-,-,-,-,-,x,x,x,x,-",
  85.             "-,-,-,-,-,-,x,x,x,-",
  86.             "-,-,-,-,-,-,x,x,x,-",
  87.             "-,-,-,-,-,-,-,x,x,-",
  88.             "-,-,-,-,-,-,-,-,x,-",
  89.         ]
  90.     },{
  91.         name: "Devil Wings",
  92.         setting:{
  93.             startingY: 0.6,
  94.             distanceFromPlayer: 0.2,
  95.             distanceBetweenY: 0.1,
  96.             distanceBetweenParticles: 0.1
  97.         },
  98.         particle:[
  99.             {name: "x" ,type: "reddust"},
  100.             {name: "+" ,type: "flame"},
  101.         ],
  102.         line:[
  103.             "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+",
  104.             "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+,-",
  105.             "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+,-,-",
  106.             "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,-,-,-",
  107.             "-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-",
  108.             "-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-,-",
  109.             "-,-,-,-,-,-,-,-,-,-,-,x,x,x,x,+,-,-,-,-,-",
  110.             "-,-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-,-,x,+,-",
  111.             "-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-,x,x,+,-,-",
  112.             "-,-,-,-,-,-,-,x,x,x,+,-,-,-,-,x,x,+,-,-,-",
  113.             "-,-,-,-,-,-,x,x,+,-,-,-,-,x,x,+,-,-,-,-,-",
  114.             "-,-,-,-,x,x,x,+,-,-,-,x,x,x,+,-,-,-,-,-,-",
  115.             "-,-,-,x,x,+,-,-,-,x,x,x,+,-,-,-,-,-,-,-,-",
  116.             "-,-,x,x,x,-,-,x,x,x,+,-,-,-,-,-,x,+,-,-,-",
  117.             "-,-,-,x,x,x,x,x,+,-,-,-,-,x,x,x,+,-,-,-,-",
  118.             "-,-,-,-,x,x,x,+,-,-,x,x,x,x,+,-,-,-,-,-,-",
  119.             "-,-,-,-,x,x,x,-,-,x,x,x,+,-,-,-,-,-,-,-,-",
  120.             "-,-,-,-,-,x,x,x,x,x,+,-,-,-,-,x,+,-,-,-,-",
  121.             "-,-,-,-,-,x,x,x,+,-,-,-,x,x,x,+,-,-,-,-,-",
  122.             "-,-,-,-,x,x,x,+,-,-,-,x,x,+,-,-,-,-,-,-,-",
  123.             "-,-,-,-,x,x,x,-,-,x,x,+,-,-,-,-,-,-,-,-,-",
  124.             "-,-,-,x,x,x,x,x,x,x,+,-,-,-,-,-,-,-,-,-,-",
  125.             "x,x,x,x,x,x,x,x,-,-,-,-,-,-,-,-,-,-,-,-,-",
  126.             "-,x,x,-,-,-,x,x,-,-,-,-,-,-,-,-,-,-,-,-,-",
  127.             "-,-,x,x,-,-,-,x,x,-,-,-,-,-,-,-,-,-,-,-,-",
  128.             "-,-,-,x,x,-,-,-,x,x,-,-,-,-,-,-,-,-,-,-,-",
  129.             "-,-,-,-,x,x,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-",
  130.         ]
  131.     },
  132. ];
RAW Paste Data