Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables:
- {firework} = false
- {loopStarted} = false
- #-----------------------------------------------------------------
- # Système de sélection de zone
- #-----------------------------------------------------------------
- on leftclick with stick:
- if player has stick named "&4&lSuperStick":
- cancel event
- set {a} to event-location
- message "<yellow>Point A ajouté"
- on rightclick with stick:
- if player has stick named "&4&lSuperStick":
- if {a} is set:
- set {_b} to event-location
- message "<yellow>Point B ajouté"
- set {_a.x} to round x-coord of {a}
- set {_a.y} to round y-coord of {a}
- set {_a.z} to round z-coord of {a}
- set {_b.x} to round x-coord of {_b}
- set {_b.y} to round y-coord of {_b}
- set {_b.z} to round z-coord of {_b}
- if {_a.x} is smaller than {_b.x}:
- set {_ab.x} to "%{_a.x}%,%{_b.x}%"
- else:
- set {_ab.x} to "%{_b.x}%,%{_a.x}%"
- if {_a.y} is smaller than {_b.y}:
- set {_ab.y} to "%{_a.y}%,%{_b.y}%"
- else:
- set {_ab.y} to "%{_b.y}%,%{_a.y}%"
- if {_a.z} is smaller than {_b.z}:
- set {_ab.z} to "%{_a.z}%,%{_b.z}%"
- else:
- set {_ab.z} to "%{_b.z}%,%{_a.z}%"
- set {area} to "%{_ab.x}%,%{_ab.y}%,%{_ab.z}%"
- delete {a}
- else:
- message "<pink>Veuillez d'abord sélectionner le point A"
- #-----------------------------------------------------------------
- # Activation / désactivation du feu d'artifice
- #-----------------------------------------------------------------
- command /toggleFirework:
- aliases: /tf
- trigger:
- if {firework} is false:
- set {firework} to true
- else:
- set {firework} to false
- #-----------------------------------------------------------------
- # Si le feu d'artifice est activé, cela génère des feux d'artifice aléatoires
- # à l'intérieur de la zone que vous aurez sélectionné.
- #-----------------------------------------------------------------
- every 5 ticks:
- if {area} is set:
- if {firework} is true:
- set {_area.coords::*} to {area} split at ","
- loop {_area.coords::*}:
- set {_area.coord_%loop-index%} to loop-value parsed as number
- set {_x} to random number between {_area.coord_1} and {_area.coord_2}
- set {_y} to random number between {_area.coord_3} and {_area.coord_4}
- set {_z} to random number between {_area.coord_5} and {_area.coord_6}
- set {_lifeTime} to random integer between 0 and 40
- set {_flight} to random integer between 0 and 3
- set {_flicker} to random integer between 0 and 1
- set {_trail} to random integer between 0 and 1
- set {_type} to random integer between 0 and 4
- set {_numberOfColors} to random integer between 1 and 10
- set {_i} to 0
- while {_i} is smaller than {_numberOfColors}:
- set {_r} to random integer between 0 and 255
- set {_g} to random integer between 0 and 255
- set {_b} to random integer between 0 and 255
- set {_decimalColor} to {_b} + 256 * {_g} + 65536 * {_r}
- add "%{_decimalColor}%" to {_colors::*}
- set {_i} to {_i} + 1
- set {_colors} to join {_colors::*} with ","
- execute console command "/summon FireworksRocketEntity %{_x}% %{_y}% %{_z}% {LifeTime:%{_lifeTime}%,FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Flight:%{_flight}%,Explosions:[{Flicker:%{_flicker}%,Trail:%{_trail}%,Type:%{_type}%,Colors:[%{_colors}%]}]}}}}"
- #-----------------------------------------------------------------
- # Give du baton qui sert à la sélection de la zone pour le feu d'artifice
- #-----------------------------------------------------------------
- command /superStick:
- aliases: /ss
- trigger:
- execute player command "/give %player% stick 1 {display:{Name:&4&lSuperStick}}"
Advertisement
Add Comment
Please, Sign In to add comment