Aller au contenu

Messages recommandés

Posté(e)

Salut j'ai un petit soucis avec un de mes skripts, alors je voulais savoir si quelqu'un serait faire en sorte de détecter la position Y d'un bloc. Car avec mon skript de génération de coffre aléatoire dans la map, les coffre spawn bien mais le soucis et qu'il spawn dans les aires ce que je trouve chiant, j'aimerai donc les faire spawn sur terre pour que les coffre soit accessible. Voila un morceau de mon skript:

 

loop 100 times:

set {_x} to random number between -100 and 100

set {_y} to random number between 80 and 120

set {_z} to random number between -100 and 100

set {coffre} to location at {_x}, {_y}, {_z}

 

J'épsère trouver de l'aide car j'ai bon chercher je n'arrive pas trouver :/. Merci d'avance bonne journée.

Posté(e)

Tu as bien mis la tabulation?

 

Sinon ça donne ça :

 

loop 100 times:
   set {_x} to random number between -100 and 100
   set {_y} to random number between 80 and 120
   set {_z} to random number between -100 and 100
   set {coffre} to location at {_x}, {_y}, {_z}

Posté(e)

loop 100 times:
   set {_x} to random number between -100 and 100
   set {_y} to random number between 80 and 120
   set {_z} to random number between -100 and 100
   set {coffre} to location at {_x}, {_y}, {_z}
   while block at {coffre} is not air:
       add 1 to y-location of {coffre}
       wait 1 tick

Sa fait spawn le coffre en haut de la terre à coup sur, mais le serveur peut crash je l'ai pas testé alors fais attention!

Posté(e)
loop 100 times:
   set {_x} to random number between -100 and 100
   set {_y} to random number between 80 and 120
   set {_z} to random number between -100 and 100
   set {coffre} to location at {_x}, {_y}, {_z}
   while block at {coffre} is not air:
       add 1 to y-location of {coffre}
       wait 1 tick

Sa fait spawn le coffre en haut de la terre à coup sur, mais le serveur peut crash je l'ai pas testé alors fais attention!

Ça ne resoud pas le problème des coffres qui volent :/

Posté(e)

loop 100 times:
   set {_x} to random number between -100 and 100
   set {_y} to random number between 80 and 120
   set {_z} to random number between -100 and 100
   set {coffre} to location at {_x}, {_y}, {_z}
   while block at {coffre} is not air:
       add 1 to y-location of {coffre}
       wait 1 tick
while block 1 block under {coffre} is air:
remove 1 from y-location of {coffre}
       wait 1 tick

Sa devrais marcher

  • J'aime 1
Posté(e)
loop 100 times:
   set {_x} to random number between -100 and 100
   set {_y} to random number between 80 and 120
   set {_z} to random number between -100 and 100
   set {coffre} to location at {_x}, {_y}, {_z}
   while block at {coffre} is not air:
       add 1 to y-location of {coffre}
       wait 1 tick
while block 1 block under {coffre} is air:
remove 1 from y-location of {coffre}
       wait 1 tick

Sa devrais marcher

Ok je vais essayer sa et je te tien au courant et merci ^^

Posté(e)

j'ai tester sa à pas l'aire de marcher :/ Je te passe mon skript entier , et y a t'il besoin d'addons ?

 

command /coffre:

trigger:

loop 10000 times:

set {_x} to random number between -100 and 100

set {_y} to random number between 80 and 120

set {_z} to random number between -100 and 100

set {coffre} to location at {_x}, {_y}, {_z}

set block at {coffre} to chest

chance of 15%:

add 1 diamond to {_list.objet.random::*}

chance of 25%:

add 1 diamond sword to {_list.objet.random::*}

chance of 35%:

add 1 iron ingot to {_list.objet.random::*}

chance of 45%:

add 1 gold ingot to {_list.objet.random::*}

chance of 55%:

add 1 redstone block to {_list.objet.random::*}

chance of 85%:

add 1 diamond leggings to {_list.objet.random::*}

launch ball firework colored red at {coffre} timed 1 # Un feu d'artifice apparait à l'endroit du coffre

add {_list.objet.random::*} to inventory of block at {coffre} # On ajoute la liste des items dans le coffre

clear {_list.objet.random::*}

broadcast "&8&l[&c&lCoffre&8&l] &cUn coffre de loot est apparut en &7%{coffre}%" # Un message annonce les coordonnés du coffre

wait 0.01 seconds # On attend 0.4 second entre chaque coffres

Posté(e)
 
command /coffre:
   trigger:
       loop 10000 times:
           set {_x} to random number between -100 and 100
           set {_y} to random number between 80 and 120
           set {_z} to random number between -100 and 100
           set {coffre} to location at {_x}, {_y}, {_z}
           set block at {coffre} to chest
           chance of 15%:
               add 1 diamond to {_list.objet.random::*}
           chance of 25%:
               add 1 diamond sword to {_list.objet.random::*}
           chance of 35%:
               add 1 iron ingot to {_list.objet.random::*}
           chance of 45%:
               add 1 gold ingot to {_list.objet.random::*}
           chance of 55%:
               add 1 redstone block to {_list.objet.random::*}
           chance of 85%:
               add 1 diamond leggings to {_list.objet.random::*}
           launch ball firework colored red at {coffre} timed 1 # Un feu d'artifice apparait à l'endroit du coffre
           add {_list.objet.random::*} to inventory of block at {coffre} # On ajoute la liste des items dans le coffre
           clear {_list.objet.random::*}
           broadcast "&8&l[&c&lCoffre&8&l] &cUn coffre de loot est apparut en &7%{coffre}%" # Un message annonce les coordonnés du coffre
           wait 0.01 seconds # On attend 0.4 second entre chaque coffres

Posté(e)
command /coffre:
   trigger:
       loop 10000 times:
           set {_x} to random number between -100 and 100
           set {_y} to random number between 80 and 120
           set {_z} to random number between -100 and 100
           set {coffre} to location at {_x}, {_y}, {_z}
           while block at {coffre} is not air:
               add 1 to y-location of {coffre}
               wait 1 tick
           while block 1 block under {coffre} is air:
               remove 1 from y-location of {coffre}
               wait 1 tick
           set block at {coffre} to chest
           chance of 15%:
               add 1 diamond to {_list.objet.random::*}
           chance of 25%:
               add 1 diamond sword to {_list.objet.random::*}
           chance of 35%:
               add 1 iron ingot to {_list.objet.random::*}
           chance of 45%:
               add 1 gold ingot to {_list.objet.random::*}
           chance of 55%:
               add 1 redstone block to {_list.objet.random::*}
           chance of 85%:
               add 1 diamond leggings to {_list.objet.random::*}
           launch ball firework colored red at {coffre} timed 1 # Un feu d'artifice apparait à l'endroit du coffre
           add {_list.objet.random::*} to inventory of block at {coffre} # On ajoute la liste des items dans le coffre
           clear {_list.objet.random::*}
           broadcast "&8&l[&c&lCoffre&8&l] &cUn coffre de loot est apparut en &7%{coffre}%" # Un message annonce les coordonnés du coffre
           wait 0.01 seconds

Posté(e)
command /coffre:
   trigger:
       loop 10000 times:
           set {_x} to random number between -100 and 100
           set {_y} to random number between 80 and 120
           set {_z} to random number between -100 and 100
           set {coffre} to location at {_x}, {_y}, {_z}
           while block at {coffre} is not air:
               add 1 to y-location of {coffre}
               wait 1 tick
           while block 1 block under {coffre} is air:
               remove 1 from y-location of {coffre}
               wait 1 tick
           set block at {coffre} to chest
           chance of 15%:
               add 1 diamond to {_list.objet.random::*}
           chance of 25%:
               add 1 diamond sword to {_list.objet.random::*}
           chance of 35%:
               add 1 iron ingot to {_list.objet.random::*}
           chance of 45%:
               add 1 gold ingot to {_list.objet.random::*}
           chance of 55%:
               add 1 redstone block to {_list.objet.random::*}
           chance of 85%:
               add 1 diamond leggings to {_list.objet.random::*}
           launch ball firework colored red at {coffre} timed 1 # Un feu d'artifice apparait à l'endroit du coffre
           add {_list.objet.random::*} to inventory of block at {coffre} # On ajoute la liste des items dans le coffre
           clear {_list.objet.random::*}
           broadcast "&8&l[&c&lCoffre&8&l] &cUn coffre de loot est apparut en &7%{coffre}%" # Un message annonce les coordonnés du coffre
           wait 0.01 seconds

Faut-il un autre plugin que skript comme addons ? Car la les coffre spawn toujours dans les airs

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.