Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Wings refresh delay, 0 is every tick.
- var pi = 0;
- function keyPressed(e){
- //When player click "~" key
- if(e.key==41){
- //If it have been started
- if(e.player.timers.has(91)){
- //Stop it
- e.player.timers.reset(91);
- e.player.timers.stop(91);
- }else{
- //Start it
- e.player.timers.forceStart(91,pi,true);
- }
- }
- }
- function timer(e){
- if(e.id==91){
- var p = e.player;
- //Set wings
- var w = wing[0];
- //Traversing the wings of the particles corresponds to each row
- for(var i = 1;i<w.line.length+1;i++){
- //Traversing the particle's specified row of particles corresponding to the search word
- for(var j = 0;j<w.line[w.line.length-i].split(",").length;j++){
- //Traverse particle entries
- for(var k = 0;k<w.particle.length;k++){
- //If the current particle search word is the corresponding entry search word
- if(w.line[w.line.length-i].split(",")[j]==w.particle[k].name){
- //Generate left wing
- 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);
- //Generate right wing
- 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);
- }
- }
- }
- }
- }
- }
- //Wings list
- var wing = [
- {
- //Wings name
- name: "Angel Wings",
- //Wings setting
- setting:{
- //The starting height of the wing
- startingY: -0.2,
- //The starting distance from the player
- distanceFromPlayer: 0.2,
- //The distance between each particle in the vertical direction.
- distanceBetweenY: 0.1,
- //The distance between each particle in the horizonal direction.
- distanceBetweenParticles: 0.08
- },
- //The ID of the particle used as a character in the line
- particle:[
- {
- //Praticle character
- name: "x" ,
- //Praticle name
- type: "enchantmenttable"
- },
- ],
- //The grid layout of the wing. use an '-' to not spawn a particle
- line:[
- "-,-,-,-,x,x,x,-,-,-",
- "-,-,-,x,x,x,x,x,-,-",
- "-,-,x,x,x,x,x,x,x,-",
- "-,x,x,x,x,x,x,x,x,-",
- "x,x,x,x,x,x,x,x,x,x",
- "x,x,x,x,x,x,x,x,x,x",
- "x,x,x,x,x,x,x,x,x,x",
- "x,x,x,x,x,x,x,x,x,x",
- "-,-,x,x,x,x,x,x,x,x",
- "-,-,-,x,x,x,x,x,x,x",
- "-,-,-,x,x,x,x,x,x,x",
- "-,-,-,-,x,x,x,x,x,x",
- "-,-,-,-,x,x,x,x,x,x",
- "-,-,-,-,-,x,x,x,x,-",
- "-,-,-,-,-,x,x,x,x,-",
- "-,-,-,-,-,-,x,x,x,-",
- "-,-,-,-,-,-,x,x,x,-",
- "-,-,-,-,-,-,-,x,x,-",
- "-,-,-,-,-,-,-,-,x,-",
- ]
- },{
- name: "Devil Wings",
- setting:{
- startingY: 0.6,
- distanceFromPlayer: 0.2,
- distanceBetweenY: 0.1,
- distanceBetweenParticles: 0.1
- },
- particle:[
- {name: "x" ,type: "reddust"},
- {name: "+" ,type: "flame"},
- ],
- line:[
- "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+",
- "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+,-",
- "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,+,-,-",
- "-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,-,-,-",
- "-,-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-",
- "-,-,-,-,-,-,-,-,-,-,-,-,-,x,x,x,+,-,-,-,-",
- "-,-,-,-,-,-,-,-,-,-,-,x,x,x,x,+,-,-,-,-,-",
- "-,-,-,-,-,-,-,-,-,-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