Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.13
Version de Skript : 2.5-alpha3

Addons utilisés: Tout les add-ons

Bonjour j'ai besoin d'aide pour mon skript car il me dit qu'il ne comprend pas la condition alors que normalement ça ne fait pas ça; voici le code

 

function pgGenerate(n: number, a1: number, a2: number, b1: number, b2: number, c1: number, c2: number, d: number, shape: text, block: itemtype, pos: location, facing: text, p: player):
	set {_failure} to 0
	send "%nl%&aTestParkour &8•&7 Génération d'un parcours de &e%{_n}+1%&7 bloc(s)." to {_p}
	if block at {_pos} is air:
		set block at {_pos} to {_block}
	else:
		add 1 to {_failure}
	loop {_n} times:
		if {_shape} is "upwards":
			set {_i} to random integer between 0 and 1
		if {_shape} is "flat":
			set {_i} to 0
		if {_shape} is "down":
			set {_i} to random integer between 0 and -1
		set {_i1} to random integer between {_a1} and {_a2}
		set {_i2} to random integer between {_b1} and {_b2}
		set {_i3} to random integer between {_c1} and {_c2}
		if {_i2}-{_i3} = 0:
			{_i} = 0
			add 1 to {_i1}
		set {_pos} to block {_i} meter above {_pos}
		if {_facing} is "north":
			set {_pos} to block {_i1} meters behind {_pos}		
			set {_pos} to block {_i2} meter left {_pos}
			set {_pos} to block {_i3} meter right {_pos}		
		if {_facing} is "west":
			set {_pos} to block {_i1} meters right {_pos}
			set {_pos} to block {_i2} meter behind {_pos}
			set {_pos} to block {_i3} meter in front of {_pos}	
		if {_facing} is "east":
			set {_pos} to block {_i1} meters left {_pos}
			set {_pos} to block {_i2} meter in front of {_pos}
			set {_pos} to block {_i3} meter behind {_pos}
		if {_facing} is "south":
			set {_pos} to block {_i1} meters in front of {_pos}
			set {_pos} to block {_i2} meter right {_pos}
			set {_pos} to block {_i3} meter left {_pos}			
		if block at {_pos} is air:
			set block at {_pos} to {_block}
		else:
			add 1 to {_failure}
	send "%nl%&aTestParkour &8•&7 Génération du parcours terminée." to {_p} if {_failure} = 0
	send "%nl%&aTestParkour &8•&7 Génération du parcours terminée, &e%{_failure}%&7 bloc(s) n'ont pas pu être placés." to {_p} if {_failure} > 0
	
function pgHelp(p: player):
	send "%nl%&aAide - TestParkour &7: Les différentes commandes%nl%" to {_p}
moyen " &7• &e/pg generate <taille> (moyen|moyen|difficile|expert|hardcore) (upwards|flat|down)" to {_p}
	send " &7• &e/pg help%nl%" to {_p}
	
function pgInvalidBlock(p: player):
	send "%nl%&aTestParkour &8•&7 Vous devez exécuter la commande avec un bloc dans la main." to {_p}
		
command /TestParkour [<text>] [<integer>] [<text>] [<text>]:
	aliases: pg
	permission: op
	executable by: player
	trigger:
		if arg-1 is "generate":
			arg-2 > 0
			arg-4 is "upwards" or "flat" or "down"
			if player's tool is not air:
				if player.getInventory().getItemInMainHand().getType().isBlock():
					if arg-3 contains "moyen":
						pgGenerate((arg-2)-1,2,3,0,2,0,2,1,arg-4,player's tool,block below player,"%player's facing%",player)
						stop
					if arg-3 contains "moyen":
						pgGenerate((arg-2)-1,2,3,0,3,0,3,2,arg-4,player's tool,block below player,"%player's facing%",player)
						stop
					if arg-3 contains "difficile":
						pgGenerate((arg-2)-1,3,3,2,3,2,3,3,arg-4,player's tool,block below player,"%player's facing%",player)
						stop
					if arg-3 contains "expert":
						pgGenerate((arg-2)-1,3,4,2,3,2,3,4,arg-4,player's tool,block below player,"%player's facing%",player)
						stop
					if arg-3 contains "hardcore":
						pgGenerate((arg-2)-1,4,4,2,3,2,3,5,arg-4,player's tool,block below player,"%player's facing%",player)
						stop
				else:
					pgInvalidBlock(player)
					stop
			else:
				pgInvalidBlock(player)
				stop
		pgHelp(player)


on join:
	set slot 4 of player to a diamond axe named "&6&lMenu Principal"



on break:
	if player is not op:
	cancel event


on rightclick:
	if player's tools named "&6&lMenu Principal":
	open chest with 3 rows named "&6&lMenu Principal" to player
	format slot 9 of player with blue stained glass pane named "&bJump facile" to run [make player execute command "/547jumpfacile"]
	format slot 11 of player with green stained glass pane named "&aJump normal" to run [make player execute command "/547jumpnormal"]
	format slot 13 of player with orange stained glass pane named "&6Jump moyen" to run [make player execute command "/547jumpmoyen"]
	format slot 15 of player with purple stained glass pane named "&5Jump difficile" to run [make player execute command "/547jumphard"]
	format slot 17 of player with red stained glass pane named "&cJump expert" to run [make player execute command "/547jumpexpert"]
	format slot 19 of player with black stained glass pane named "&8Jump Hardcore" to run [make player execute command "/547jumphardcore"]


command /547jumpfacile:
	trigger:
	open chest with 3 rows named "&bJump Facile - Couleur" to player
	format slot 9 of player with orange banner named "&6Jump Orange" to run [make player execute command "/confirmfacileorange"]
	format slot 10 of player with magenta banner named "&5Jump Magenta" to run [make player execute command "/confirmfacilemagenta"]
	format slot 11 of player with light blue banner named "&6Jump Bleu Clair" to run [make player execute command "/confirmfacilelightblue"]
	format slot 12 of player with lime banner named "&aJump Vert" to run [make player execute command "/confirmfacilelime"]
	format slot 13 of player with pink banner named "&dJump Rose" to run [make player execute command "/confirmfacilepink"]
	format slot 14 of player with gray banner named "&8Jump Gris" to run [make player execute command "/confirmfacilegray"]
	format slot 15 of player with light gray banner named "&7Jump Gris Clair" to run [make player execute command "/confirmfacilelightgray"]
	format slot 9 of player with orange banner named "&eJump Yellow" to run [make player execute command "/confirmfacileyellow"]
	format slot 9 of player with cyan banner named "&3Jump Cyan" to run [make player execute command "/confirmfacilecyan"]




command /547jumpmoyen:
	trigger:
		open chest with 3 rows named "&bJump moyen - Couleur" to player
		format slot 9 of player with orange banner named "&6Jump Orange" to run [make player execute command "/confirmmoyenorange"]
		format slot 10 of player with magenta banner named "&5Jump Magenta" to run [make player execute command "/confirmmoyenmagenta"]
		format slot 11 of player with light blue banner named "&6Jump Bleu Clair" to run [make player execute command "/confirmmoyenlightblue"]
		format slot 12 of player with lime banner named "&aJump Vert" to run [make player execute command "/confirmmoyenlime"]
		format slot 13 of player with pink banner named "&dJump Rose" to run [make player execute command "/confirmmoyenpink"]
		format slot 14 of player with gray banner named "&8Jump Gris" to run [make player execute command "/confirmmoyengray"]
		format slot 15 of player with light gray banner named "&7Jump Gris Clair" to run [make player execute command "/confirmmoyenlightgray"]
		format slot 9 of player with orange banner named "&eJump Yellow" to run [make player execute command "/confirmmoyenyellow"]
		format slot 9 of player with cyan banner named "&3Jump Cyan" to run [make player execute command "/confirmmoyencyan"]



command /547jumpdifficile:
	trigger:
		open chest with 3 rows named "&bJump difficile - Couleur" to player
		format slot 9 of player with orange banner named "&6Jump Orange" to run [make player execute command "/confirmdifficileorange"]
		format slot 10 of player with magenta banner named "&5Jump Magenta" to run [make player execute command "/confirmdifficilemagenta"]
		format slot 11 of player with light blue banner named "&6Jump Bleu Clair" to run [make player execute command "/confirmdifficilelightblue"]
		format slot 12 of player with lime banner named "&aJump Vert" to run [make player execute command "/confirmdifficilelime"]
		format slot 13 of player with pink banner named "&dJump Rose" to run [make player execute command "/confirmdifficilepink"]
		format slot 14 of player with gray banner named "&8Jump Gris" to run [make player execute command "/confirmdifficilegray"]
		format slot 15 of player with light gray banner named "&7Jump Gris Clair" to run [make player execute command "/confirmdifficilelightgray"]
		format slot 9 of player with orange banner named "&eJump Yellow" to run [make player execute command "/confirmdifficileyellow"]
		format slot 9 of player with cyan banner named "&3Jump Cyan" to run [make player execute command "/confirmdifficilecyan"]

2020-05-19_15_59_12.thumb.png.35946598b762d1133343768ffbf065d6.png2020-05-19_15_59_11.thumb.png.97b5614534bbd8507b17cfaf431cdbdc.png2020-05-19_15_59_10.thumb.png.3761218769a3636a4888ac6edc1babae.png2020-05-19_15_59_08.thumb.png.f6f4fb6ce34903705d305130860d65ff.png2020-05-19_15_59_16.thumb.png.5ebc9c4074b70d15ae74218d61a991cc.png2020-05-19_15_59_15.thumb.png.efd60014371cff41b5980c15f5cc569e.png2020-05-19_15_59_14.thumb.png.08cff6f770e44d9cf80da0503c45512d.png2020-05-19_15_59_13.thumb.png.7e234bd8cabeec43fe4ca6a0033219d9.png

2 réponses à cette question

Messages recommandés

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • 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.