Aller au contenu
  • 0

Le random pas random


Question

Posté(e)

Alut !

Ce soir je suis en galère car j'ai fait un système de loot auto, mais ça marche pas trop...

En fait ça me fait spawn mon pauvre coffre toujours au même endroit, c'est relou...

Le code :

options:
prefix : &4[&0*&2Simple&3Battle&0*&4]

command /loot [<text>]:
trigger:

	loop 1 times:
		set {_x} to random number between -1000 and 1000
		set {_y} to random number between 200 and 256
		set {_z} to random number between -1000 and 1000
		set {chest} to location at {_x}, {_y}, {_z}
		set block at {chest} to chest
		chance of 20%:
			add diamond sword to {_objets.random::*}
		chance of 25%:
			add diamond leggings to {_objets.random::*}
		chance of 50%:
			add iron sword to {_objets.random::*}
		chance of 75%:
			add iron chestplate to {_objets.random::*}
		chance of 90%:
			add wooden sword to {_objets.random::*}
		add {_objets.random::*} to inventory of block at {chest}
		clear {_objets.random::*}
		broadcast "{@prefix} &a>> Un coffre est apparu en %{coffre}%"
	if arg 1 is "tp":
		teleport player to {coffre}

Voilà, et éspérant avoir été assez précis !

2 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Bonjour, j'ai remis tous les lignes de ton code en vérifiant tout 1 par 1 et j'ai même testé ! Pour moi le coffre ne spawn jamais au même endroit.

 

options:
   prefix : &4[&0*&2Simple&3Battle&0*&4]

command /loot:
   trigger:
       set {_x} to random number between -1000 and 1000
       set {_y} to random number between 200 and 256
       set {_z} to random number between -1000 and 1000
       set {spawn} to location at {_x}, {_y}, {_z}
       set block at {spawn} to chest
       chance of 20%:
           add diamond sword to {_list.random::*}
       chance of 25%:
           add diamond leggings to {_list.random::*}
       chance of 50%:
           add iron sword to {_list.random::*}
       chance of 75%:
           add iron chestplate to {_list.random::*}
       chance of 90%:
           add wooden sword to {_list.random::*}
       add {_list.random::*} to inventory of block at {spawn}
       broadcast "{@prefix} &a>> Un coffre est apparu en %{spawn}%"

×
×
  • 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.