Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.16.1
Version de Skript : 2.5 alpha5

Addons utilisés: MundoSk 1.8.6 Beta 57, Quarsk 1.3.1, SkBee 1.4.5, Skellet 1.9.9, Skent 1.9, Skquery-Li!me 4.1.2, SkRayFall 1.9.21,Skript-holo 1.0.2, Skript-mirror 1.0.0, SkStuff 1.6.4.1, SkUtilities 0.9.2, TuSKe 1.8.3-PikachuPatch-v3,

Description du script :

J'ai trouvé ce skript de @Soufreur78, c'est un skript de refill de chest, mais impossible de le faire fonctionner et de trouver l'erreur, il me dit que c'est de l'indentation, sauf qu'une fois fait beh le skript marche plus et pourquoi tout mettre a 4 tabs je comprends  vraiment s'il y'a des gens qui peuvent m'aider je prends

on load:
	delete {random.item.list::*}
	add 1 diamond to {random.item.list::*}
	add 2 iron ingot to {random.item.list::*}
	add 2 leather to {random.item.list::*}
	add 2 tnt to {random.item.list::*}
	add 1 flint and steel to {random.item.list::*}
	add 1 golden apple to {random.item.list::*}
	add 4 cooked beef to {random.item.list::*}
	add 32 stone to {random.item.list::*}
	add 32 cobblestone to {random.item.list::*}
	add 4 cooked porkchop to {random.item.list::*}
	add 32 planks to {random.item.list::*}
	add 2 apple to {random.item.list::*}
	add 1 stone sword to {random.item.list::*}
	add 1 stone pickaxe to {random.item.list::*}
	add 1 stone axe to {random.item.list::*}
	add 1 leather leggings to {random.item.list::*}
	add 1 leather boots to {random.item.list::*}
	add 1 leather chestplate to {random.item.list::*}
	add 1 leather helmet to {random.item.list::*}
	add 4 snowball to {random.item.list::*}
	add 4 arrow to {random.item.list::*}
	add 1 bow to {random.item.list::*}
	add 1 iron sword to {random.item.list::*}
	add 1 iron pickaxe to {random.item.list::*}
	add 1 iron axe to {random.item.list::*}
	add 1 iron leggings to {random.item.list::*}
	add 1 iron boots to {random.item.list::*}
	add 1 iron chestplate to {random.item.list::*}
	add 1 iron helmet to {random.item.list::*}
	add 1 diamond sword to {random.item.list::*}
	add 1 diamond pickaxe to {random.item.list::*}
	add 1 diamond axe to {random.item.list::*}
	add 1 diamond boots to {random.item.list::*}
	add 1 diamond leggings to {random.item.list::*}
	add 1 diamond helmet to {random.item.list::*}
	add 1 diamond chestplate to {random.item.list::*}
	wait 2 second
	make console execute command "/chest refill"
command /chest [<text>]:
	permission: chest.use
	trigger:
		if arg 1 is not set:
			message "&7&m&l---------------------------"
			message "&8[&a&lChest&8] &b➡ Commandes  :"
			message "&c● &e/chest add &7> Ajouter un coffre"
			message "&c● &e/chest remove &7> Supprimer un coffre"
			message "&c● &e/chest clear &7> Supprimer tous les coffres"
			message "&c● &e/chest refill &7> Refill les coffres"
			message "&cPour ajouter/supprimer un coffre"
			message "&cil faut le regarder et faire la commande"
			message "&7&m&l---------------------------"
			else:
				if arg 1 is not "add" or "remove" or "refill" or "clear":
				make player execute command "/chest"
					else:
						if arg 1 is "clear":
						clear {Chest.location::*}
						message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"
					if arg 1 is "add":
						if targeted block is a chest:
							loop {Chest.location::*}:
									if loop-value is location of targeted block:
										message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"
										stop
							add location of targeted block to {Chest.location::*}
							message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
						else:
							message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
					if arg 1 is "remove":
						if targeted block is a chest:
							loop {Chest.location::*}:
									if loop-value is location of targeted block:
										message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
										remove location of targeted block from {Chest.location::*}
										stop
							message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"
						else:
							message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
					if arg 1 is "refill":
						loop {Chest.location::*}:
							set {_slot::*} to ""
							loop 27 times:
									add loop-number to {_number::*}
							clear inventory of block at loop-value
							set {_nbr} to a random number between 3 and 6
							loop {_nbr} times:
									set {_item} to a random element out of {random.item.list::*}
									set {_slot} to a random element out of {_number::*}
									add {_item} to slot ({_slot} - 1) of block at loop-value-1
							message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"

Et voici les logs: 

 

[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 5 tabs (chest.sk, line 57: else:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 58: if arg 1 is "clear":')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 59: clear {Chest.location::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 60: message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 5 tabs (chest.sk, line 61: if arg 1 is "add":')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 62: if targeted block is a chest:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 63: loop {Chest.location::*}:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 64: if loop-value is location of targeted block:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 10 tabs (chest.sk, line 65: message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 10 tabs (chest.sk, line 66: stop')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 67: add location of targeted block to {Chest.location::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 68: message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 69: else:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 70: message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 5 tabs (chest.sk, line 71: if arg 1 is "remove":')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 72: if targeted block is a chest:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 73: loop {Chest.location::*}:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 74: if loop-value is location of targeted block:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 10 tabs (chest.sk, line 75: message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 10 tabs (chest.sk, line 76: remove location of targeted block from {Chest.location::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 10 tabs (chest.sk, line 77: stop')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 78: message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 79: else:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 80: message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 5 tabs (chest.sk, line 81: if arg 1 is "refill":')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 6 tabs (chest.sk, line 82: loop {Chest.location::*}:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 83: set {_slot::*} to ""')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 84: loop 27 times:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 85: add loop-number to {_number::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 86: clear inventory of block at loop-value')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 87: set {_nbr} to a random number between 3 and 6')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 88: loop {_nbr} times:')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 89: set {_item} to a random element out of {random.item.list::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 90: set {_slot} to a random element out of {_number::*}')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 9 tabs (chest.sk, line 91: add {_item} to slot ({_slot} - 1) of block at loop-value-1')
[14:00:26 ERROR]: indentation error: expected 4 tabs, but found 7 tabs (chest.sk, line 92: message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"')
[14:00:26 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (chest.sk, line 54: else:')

Merci d'avance pour l'aide ^^

7 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

il faut que tu apprennes les erreurs que skript t'affiche la il te dit que tes tabulations ne sont pas bonne exemple:

loop all blocs:
		send "%loop-block%"

dans ce skript j'ai mis 2 tabulations la le skript va me mettre une erreur car il faut 1 tabulation donc pour corriger

loop all blocs:
	send "%loop-block%"

la c'est correcte je n'aurais pas d'erreur donc je t'ai réparé les problèmes de tabulations par ce que je suis gentil

on load:
	delete {random.item.list::*}
	add 1 diamond to {random.item.list::*}
	add 2 iron ingot to {random.item.list::*}
	add 2 leather to {random.item.list::*}
	add 2 tnt to {random.item.list::*}
	add 1 flint and steel to {random.item.list::*}
	add 1 golden apple to {random.item.list::*}
	add 4 cooked beef to {random.item.list::*}
	add 32 stone to {random.item.list::*}
	add 32 cobblestone to {random.item.list::*}
	add 4 cooked porkchop to {random.item.list::*}
	add 32 planks to {random.item.list::*}
	add 2 apple to {random.item.list::*}
	add 1 stone sword to {random.item.list::*}
	add 1 stone pickaxe to {random.item.list::*}
	add 1 stone axe to {random.item.list::*}
	add 1 leather leggings to {random.item.list::*}
	add 1 leather boots to {random.item.list::*}
	add 1 leather chestplate to {random.item.list::*}
	add 1 leather helmet to {random.item.list::*}
	add 4 snowball to {random.item.list::*}
	add 4 arrow to {random.item.list::*}
	add 1 bow to {random.item.list::*}
	add 1 iron sword to {random.item.list::*}
	add 1 iron pickaxe to {random.item.list::*}
	add 1 iron axe to {random.item.list::*}
	add 1 iron leggings to {random.item.list::*}
	add 1 iron boots to {random.item.list::*}
	add 1 iron chestplate to {random.item.list::*}
	add 1 iron helmet to {random.item.list::*}
	add 1 diamond sword to {random.item.list::*}
	add 1 diamond pickaxe to {random.item.list::*}
	add 1 diamond axe to {random.item.list::*}
	add 1 diamond boots to {random.item.list::*}
	add 1 diamond leggings to {random.item.list::*}
	add 1 diamond helmet to {random.item.list::*}
	add 1 diamond chestplate to {random.item.list::*}
	wait 2 second
	make console execute command "/chest refill"
command /chest [<text>]:
	permission: chest.use
	trigger:
		if arg 1 is not set:
			message "&7&m&l---------------------------"
			message "&8[&a&lChest&8] &b➡ Commandes  :"
			message "&c● &e/chest add &7> Ajouter un coffre"
			message "&c● &e/chest remove &7> Supprimer un coffre"
			message "&c● &e/chest clear &7> Supprimer tous les coffres"
			message "&c● &e/chest refill &7> Refill les coffres"
			message "&cPour ajouter/supprimer un coffre"
			message "&cil faut le regarder et faire la commande"
			message "&7&m&l---------------------------"
		else:
			if arg 1 is not "add" or "remove" or "refill" or "clear":
				make player execute command "/chest"
			else:
				if arg 1 is "clear":
				clear {Chest.location::*}
				message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"
			if arg 1 is "add":
				if targeted block is a chest:
					loop {Chest.location::*}:
						if loop-value is location of targeted block:
							message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"
							stop
					add location of targeted block to {Chest.location::*}
					message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
				else:
					message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
			if arg 1 is "remove":
				if targeted block is a chest:
					loop {Chest.location::*}:
						if loop-value is location of targeted block:
							message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
							remove location of targeted block from {Chest.location::*}
							stop
					message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"
				else:
					message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
			if arg 1 is "refill":
				loop {Chest.location::*}:
					set {_slot::*} to ""
					loop 27 times:
						add loop-number to {_number::*}
					clear inventory of block at loop-value
					set {_nbr} to a random number between 3 and 6
					loop {_nbr} times:
						set {_item} to a random element out of {random.item.list::*}
						set {_slot} to a random element out of {_number::*}
						add {_item} to slot ({_slot} - 1) of block at loop-value-1
					message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"

Y a plus aucune erreur (pour moi)

Modifié par zarco70
  • J'aime 1
  • 0
Posté(e) (modifié)
Il y a 22 heures, zarco70 a dit :

il faut que tu apprennes les erreurs que skript t'affiche la il te dit que tes tabulations ne sont pas bonne exemple:


loop all blocs:
		send "%loop-block%"

dans ce skript j'ai mis 2 tabulations la le skript va me mettre une erreur car il faut 1 tabulation donc pour corriger


loop all blocs:
	send "%loop-block%"

la c'est correcte je n'aurais pas d'erreur donc je t'ai réparé les problèmes de tabulations par ce que je suis gentil


on load:
	delete {random.item.list::*}
	add 1 diamond to {random.item.list::*}
	add 2 iron ingot to {random.item.list::*}
	add 2 leather to {random.item.list::*}
	add 2 tnt to {random.item.list::*}
	add 1 flint and steel to {random.item.list::*}
	add 1 golden apple to {random.item.list::*}
	add 4 cooked beef to {random.item.list::*}
	add 32 stone to {random.item.list::*}
	add 32 cobblestone to {random.item.list::*}
	add 4 cooked porkchop to {random.item.list::*}
	add 32 planks to {random.item.list::*}
	add 2 apple to {random.item.list::*}
	add 1 stone sword to {random.item.list::*}
	add 1 stone pickaxe to {random.item.list::*}
	add 1 stone axe to {random.item.list::*}
	add 1 leather leggings to {random.item.list::*}
	add 1 leather boots to {random.item.list::*}
	add 1 leather chestplate to {random.item.list::*}
	add 1 leather helmet to {random.item.list::*}
	add 4 snowball to {random.item.list::*}
	add 4 arrow to {random.item.list::*}
	add 1 bow to {random.item.list::*}
	add 1 iron sword to {random.item.list::*}
	add 1 iron pickaxe to {random.item.list::*}
	add 1 iron axe to {random.item.list::*}
	add 1 iron leggings to {random.item.list::*}
	add 1 iron boots to {random.item.list::*}
	add 1 iron chestplate to {random.item.list::*}
	add 1 iron helmet to {random.item.list::*}
	add 1 diamond sword to {random.item.list::*}
	add 1 diamond pickaxe to {random.item.list::*}
	add 1 diamond axe to {random.item.list::*}
	add 1 diamond boots to {random.item.list::*}
	add 1 diamond leggings to {random.item.list::*}
	add 1 diamond helmet to {random.item.list::*}
	add 1 diamond chestplate to {random.item.list::*}
	wait 2 second
	make console execute command "/chest refill"
command /chest [<text>]:
	permission: chest.use
	trigger:
		if arg 1 is not set:
			message "&7&m&l---------------------------"
			message "&8[&a&lChest&8] &b➡ Commandes  :"
			message "&c● &e/chest add &7> Ajouter un coffre"
			message "&c● &e/chest remove &7> Supprimer un coffre"
			message "&c● &e/chest clear &7> Supprimer tous les coffres"
			message "&c● &e/chest refill &7> Refill les coffres"
			message "&cPour ajouter/supprimer un coffre"
			message "&cil faut le regarder et faire la commande"
			message "&7&m&l---------------------------"
		else:
			if arg 1 is not "add" or "remove" or "refill" or "clear":
				make player execute command "/chest"
			else:
				if arg 1 is "clear":
				clear {Chest.location::*}
				message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"
			if arg 1 is "add":
				if targeted block is a chest:
					loop {Chest.location::*}:
						if loop-value is location of targeted block:
							message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"
							stop
					add location of targeted block to {Chest.location::*}
					message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
				else:
					message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
			if arg 1 is "remove":
				if targeted block is a chest:
					loop {Chest.location::*}:
						if loop-value is location of targeted block:
							message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
							remove location of targeted block from {Chest.location::*}
							stop
					message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"
				else:
					message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
			if arg 1 is "refill":
				loop {Chest.location::*}:
					set {_slot::*} to ""
					loop 27 times:
						add loop-number to {_number::*}
					clear inventory of block at loop-value
					set {_nbr} to a random number between 3 and 6
					loop {_nbr} times:
						set {_item} to a random element out of {random.item.list::*}
						set {_slot} to a random element out of {_number::*}
						add {_item} to slot ({_slot} - 1) of block at loop-value-1
					message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"

Y a plus aucune erreur (pour moi)

Merci de ton intervention et de ton aide mais je sais lire les logs t’inquiète pas je trouver cela juste bizarre qu'il me demande de tout caler sur 4 tabs, chose qui aurait rendu le skript non fonctionnel, mais merci de ton aide

EDIT: J'ai eu des erreurs mais avec mon sens affiné de lecture de logs j'ai pu réussir à découvrir où était le souci

Voila le code final, si besoin :

on load:
    delete {random.item.list::*}
    add 1 diamond to {random.item.list::*}
    add 2 iron ingot to {random.item.list::*}
    add 2 leather to {random.item.list::*}
    add 2 tnt to {random.item.list::*}
    add 1 flint and steel to {random.item.list::*}
    add 1 golden apple to {random.item.list::*}
    add 4 cooked beef to {random.item.list::*}
    add 32 stone to {random.item.list::*}
    add 32 cobblestone to {random.item.list::*}
    add 4 cooked porkchop to {random.item.list::*}
    add 32 planks to {random.item.list::*}
    add 2 apple to {random.item.list::*}
    add 1 stone sword to {random.item.list::*}
    add 1 stone pickaxe to {random.item.list::*}
    add 1 stone axe to {random.item.list::*}
    add 1 leather leggings to {random.item.list::*}
    add 1 leather boots to {random.item.list::*}
    add 1 leather chestplate to {random.item.list::*}
    add 1 leather helmet to {random.item.list::*}
    add 4 snowball to {random.item.list::*}
    add 4 arrow to {random.item.list::*}
    add 1 bow to {random.item.list::*}
    add 1 iron sword to {random.item.list::*}
    add 1 iron pickaxe to {random.item.list::*}
    add 1 iron axe to {random.item.list::*}
    add 1 iron leggings to {random.item.list::*}
    add 1 iron boots to {random.item.list::*}
    add 1 iron chestplate to {random.item.list::*}
    add 1 iron helmet to {random.item.list::*}
    add 1 diamond sword to {random.item.list::*}
    add 1 diamond pickaxe to {random.item.list::*}
    add 1 diamond axe to {random.item.list::*}
    add 1 diamond boots to {random.item.list::*}
    add 1 diamond leggings to {random.item.list::*}
    add 1 diamond helmet to {random.item.list::*}
    add 1 diamond chestplate to {random.item.list::*}
command /chest [<text>]:
    permission: chest.use
    trigger:
        if arg 1 is not set:
            message "&7&m&l---------------------------"
            message "&8[&a&lChest&8] &b➡ Commandes  :"
            message "&c● &e/chest add &7> Ajouter un coffre"
            message "&c● &e/chest remove &7> Supprimer un coffre"
            message "&c● &e/chest clear &7> Supprimer tous les coffres"
            message "&c● &e/chest refill &7> Refill les coffres"
            message "&cPour ajouter/supprimer un coffre"
            message "&cil faut le regarder et faire la commande"
            message "&7&m&l---------------------------"
        else:
            if arg 1 is not "add" or "remove" or "refill" or "clear":
                make player execute command "/chest"
            else:
                if arg 1 is "clear":
                    clear {Chest.location::*}
                    message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"
                if arg 1 is "add":
                    if targeted block is a chest:
                        loop {Chest.location::*}:
                            if loop-value is location of targeted block:
                                message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"
                                stop
                        add location of targeted block to {Chest.location::*}
                        message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
                    else:
                        message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
                if arg 1 is "remove":
                    if targeted block is a chest:
                        loop {Chest.location::*}:
                            if loop-value is location of targeted block:
                                message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
                                remove location of targeted block from {Chest.location::*}
                                stop
                        message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"
                    else:
                        message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
                if arg 1 is "refill":
                    loop {Chest.location::*}:
                        set {_slot::*} to ""
                        loop 27 times:
                            add loop-number to {_number::*}
                        clear inventory of block at loop-value
                        set {_nbr} to a random number between 3 and 6
                        loop {_nbr} times:
                            set {_item} to a random element out of {random.item.list::*}
                            set {_slot} to a random element out of {_number::*}
                            add {_item} to slot ({_slot} - 1) of block at loop-value-1
                        message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"

 

Modifié par Spygain
  • 0
Posté(e)
Il y a 2 heures, Spygain a dit :

Merci de ton intervention et de ton aide mais je sais lire les logs t’inquiète pas je trouver cela juste bizarre qu'il me demande de tout caler sur 4 tabs, chose qui aurait rendu le skript non fonctionnel, mais merci de ton aide

EDIT: J'ai eu des erreurs mais avec mon sens affiné de lecture de logs j'ai pu réussir à découvrir où était le souci

Voila le code final, si besoin :


on load:
    delete {random.item.list::*}
    add 1 diamond to {random.item.list::*}
    add 2 iron ingot to {random.item.list::*}
    add 2 leather to {random.item.list::*}
    add 2 tnt to {random.item.list::*}
    add 1 flint and steel to {random.item.list::*}
    add 1 golden apple to {random.item.list::*}
    add 4 cooked beef to {random.item.list::*}
    add 32 stone to {random.item.list::*}
    add 32 cobblestone to {random.item.list::*}
    add 4 cooked porkchop to {random.item.list::*}
    add 32 planks to {random.item.list::*}
    add 2 apple to {random.item.list::*}
    add 1 stone sword to {random.item.list::*}
    add 1 stone pickaxe to {random.item.list::*}
    add 1 stone axe to {random.item.list::*}
    add 1 leather leggings to {random.item.list::*}
    add 1 leather boots to {random.item.list::*}
    add 1 leather chestplate to {random.item.list::*}
    add 1 leather helmet to {random.item.list::*}
    add 4 snowball to {random.item.list::*}
    add 4 arrow to {random.item.list::*}
    add 1 bow to {random.item.list::*}
    add 1 iron sword to {random.item.list::*}
    add 1 iron pickaxe to {random.item.list::*}
    add 1 iron axe to {random.item.list::*}
    add 1 iron leggings to {random.item.list::*}
    add 1 iron boots to {random.item.list::*}
    add 1 iron chestplate to {random.item.list::*}
    add 1 iron helmet to {random.item.list::*}
    add 1 diamond sword to {random.item.list::*}
    add 1 diamond pickaxe to {random.item.list::*}
    add 1 diamond axe to {random.item.list::*}
    add 1 diamond boots to {random.item.list::*}
    add 1 diamond leggings to {random.item.list::*}
    add 1 diamond helmet to {random.item.list::*}
    add 1 diamond chestplate to {random.item.list::*}
command /chest [<text>]:
    permission: chest.use
    trigger:
        if arg 1 is not set:
            message "&7&m&l---------------------------"
            message "&8[&a&lChest&8] &b➡ Commandes  :"
            message "&c● &e/chest add &7> Ajouter un coffre"
            message "&c● &e/chest remove &7> Supprimer un coffre"
            message "&c● &e/chest clear &7> Supprimer tous les coffres"
            message "&c● &e/chest refill &7> Refill les coffres"
            message "&cPour ajouter/supprimer un coffre"
            message "&cil faut le regarder et faire la commande"
            message "&7&m&l---------------------------"
        else:
            if arg 1 is not "add" or "remove" or "refill" or "clear":
                make player execute command "/chest"
            else:
                if arg 1 is "clear":
                    clear {Chest.location::*}
                    message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres de la liste"
                if arg 1 is "add":
                    if targeted block is a chest:
                        loop {Chest.location::*}:
                            if loop-value is location of targeted block:
                                message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste"
                                stop
                        add location of targeted block to {Chest.location::*}
                        message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
                    else:
                        message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
                if arg 1 is "remove":
                    if targeted block is a chest:
                        loop {Chest.location::*}:
                            if loop-value is location of targeted block:
                                message "&8[&a&lChest&8] &a➡ &eVous avez bien supprimé ce coffre, il y a maintenant &a%size of {Chest.location::*}% &ecoffres"
                                remove location of targeted block from {Chest.location::*}
                                stop
                        message "&8[&a&lChest&8] &c➡ Le coffre n'est pas dans la liste"
                    else:
                        message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre"
                if arg 1 is "refill":
                    loop {Chest.location::*}:
                        set {_slot::*} to ""
                        loop 27 times:
                            add loop-number to {_number::*}
                        clear inventory of block at loop-value
                        set {_nbr} to a random number between 3 and 6
                        loop {_nbr} times:
                            set {_item} to a random element out of {random.item.list::*}
                            set {_slot} to a random element out of {_number::*}
                            add {_item} to slot ({_slot} - 1) of block at loop-value-1
                        message "&8[&a&lChest&8] &a➡ &eLes &a%size of {Chest.location::*}% &eont été refill"

 

Ha ok bon tant mieux si ton problème est résolut

  • J'aime 1
  • 0
Posté(e)
à l’instant, Soufreur78 a dit :

Toujours marrant de voir des gens réutiliser ce code. C'est clairement pas optimisé mais ça faisait le taff à l'époque 😆

Beh content de voir que tu es la, y'aurait moyen de l'opti ou pas ? juste par curiosité ? Même si il marche très bien

  • J'aime 1
  • 0
Posté(e) (modifié)
il y a 14 minutes, Spygain a dit :

Beh content de voir que tu es la, y'aurait moyen de l'opti ou pas ? juste par curiosité ? Même si il marche très bien

Ouai je repasse de temps en temps. C'est sympa de voir les différentes demandes. Je n'ai malheureusement plus le temps de me consacrer aux demandes d'aide/de skript alors que j'adorerais le faire à l'époque. Non franchement le skript est déjà bien bien opti. La seule chose que j'aurai modifié pour me faciliter la vie c'est au niveau de l'ajout des items. Le plus rapide c'est de placer un double coffre avec tous les items dedans et ensuite faire une petite commande qui va tout récupérer pour placer les objets dans la liste. Comme ça pas besoin d'écrire tous les noms d'objet dans le skript ^^

Modifié par Soufreur78
  • J'aime 1
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.