Aller au contenu

Messages recommandés

Posté(e) (modifié)

Bonjour,

j'aimerais faire un skirp qui serait: Un pnj qui lorsque l'on click droit dessus nous propose de choisir un item dans notre inventaire, et lorsque l'on choisit une certaine armure ou une certaine arme il y a un pourcentage de change de nous donner des items (diamants, laines orange, silex, chaire putrifiée...) ou un pourcentage de nous rendre les items de fabrication (ex: 2diams pour faire un plastron en fer, lors du recyclage, il pourrait y avoir 40% de chance de nous rendre 2 diams). 
Le pnj nous demanderait de choisir un item comme je vous l'ai expliqué, et après une étape de vérification, pour éviter les miss clics. ("etes vous sur de vendre cet item?") tout ça sur des open chest, ou dans le chat, mais soit l'un soit l'autre, pas de mix.

J'espere que vous aurez compris,

merci d'avance pour votre aide. 

Modifié par EniKing_
Posté(e) (modifié)

Tqt j'ai déja fais un bout de code qui pourrais vraiment t'aider dans tes "recherches":

options:
	name: Recycleur

on rightclick on villager:
	if event-entity's name contains "{@name}":
		cancel event
		make console execute command "/recy %player%"

command /recy <player> [<text>] [<text>]:
	permission: *
	trigger:
		if arg 2 isn't set:
			open virtual chest inventory with size 3 named "{@name}" to arg-1
			format gui slot 0, 1, 2, 3, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26 of arg-1 with 1 green glass named " " to do nothing
			format gui slot 4 of arg-1 with 1 2 named "{@name}" to do nothing
			format gui slot 9 of arg-1 with 1 diamond sword with no nbt named "§6Armes" with lore "§7Clique-ici pour accéder aux armes" to run console command "/recy %arg-1% weapon"
			format gui slot 10 of arg-1 with 1 diamond chestplate with no nbt named "§6Armures" with lore "§7Clique-ici pour accéder aux armures" to run console command "/recy %arg-1% armor"

		else if arg 2 is "weapon":
			if arg 3 isn't set:
				open virtual chest inventory with size 3 named "{@name} §6» Armes" to arg-1
				format gui slot 1, 2, 3, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26 of arg-1 with 1 green glass named " " to do nothing
				format gui slot 0 of arg-1 with 1 barrier named "§c« Retour" to run console command "/recy %arg-1%"
				format gui slot 4 of arg-1 with 1 diamond sword with no nbt named "§6Armes" to do nothing
				format gui slot 9 of arg-1 with 1 diamond sword with no nbt named "§aRecycler une §6épée en diamant §a?" to run console command "/recy %arg-1% weapon diamond"
				format gui slot 10 of arg-1 with 1 golden sword with no nbt named "§aRecycler une §6épée en or §a?" to run console command "/recy %arg-1% weapon gold"
				format gui slot 11 of arg-1 with 1 iron sword with no nbt named "§aRecycler une §6épée en fer §a?" to run console command "/recy %arg-1% weapon iron"
				format gui slot 12 of arg-1 with 1 stone sword with no nbt named "§aRecycler une §6épée en pierre §a?" to run console command "/recy %arg-1% weapon cobble"
				format gui slot 13 of arg-1 with 1 wooden sword with no nbt named "§aRecycler une §6épée en bois §a?" to run console command "/recy %arg-1% weapon wood"

			else if arg 3 is "diamond":
				if arg-1 has 1 diamond sword:
					remove 1 diamond sword from arg-1's inventory
					chance of 40%:
						give 2 diamonds to arg-1

			else if arg 3 is "gold":
				if arg-1 has 1 golden sword:
					remove 1 golden sword from arg-1's inventory
					chance of 50%:
						give 2 gold ingot to arg-1

			else if arg 3 is "iron":
				if arg-1 has 1 iron sword:
					remove 1 iron sword from arg-1's inventory
					chance of 60%:
						give 2 iron ingot to arg-1

			else if arg 3 is "cobble":
				if arg-1 has 1 stone sword:
					remove 1 stone sword from arg-1's inventory
					chance of 70%:
						give 2 cobblestone to arg-1

			else if arg 3 is "wood":
				if arg-1 has 1 wooden sword:
					remove 1 wooden sword from arg-1's inventory
					chance of 80%:
						give 2 oak planks to arg-1

		else if arg 2 is "armor":
			if arg 3 isn't set:
				open virtual chest inventory with size 6 named "{@name} §6» Armures" to arg-1
				format gui slot 1, 2, 3, 5, 6, 7, 8, 45, 46, 47, 48, 49, 50, 51, 52, 53 of arg-1 with 1 green glass named " " to do nothing
				format gui slot 0 of arg-1 with 1 barrier named "§c« Retour" to run console command "/recy %arg-1%"
				format gui slot 4 of arg-1 with 1 diamond chestplate with no nbt named "§6Armures" to do nothing
				format gui slot 9 of arg-1 with 1 diamond helmet with no nbt named "§aRecycler un §6casque en diamant §a?" to run console command "/recy %arg-1% armor diamondhelmet"
				format gui slot 10 of arg-1 with 1 golden helmet with no nbt named "§aRecycler une §6casque en or §a?" to run console command "/recy %arg-1% weapon goldhelmet"
				format gui slot 11 of arg-1 with 1 iron helmet with no nbt named "§aRecycler une §6casque en fer §a?" to run console command "/recy %arg-1% weapon ironhelmet"
				format gui slot 12 of arg-1 with 1 chain helmet with no nbt named "§aRecycler une §6casque en côte de maille §a?" to run console command "/recy %arg-1% weapon chainhelmet"
				format gui slot 13 of arg-1 with 1 leather helmet with no nbt named "§aRecycler une §6casque en cuir §a?" to run console command "/recy %arg-1% weapon leatherhelmet"

			else if arg 3 is "diamondhelmet":
				if arg-1 has 1 diamond helmet:
					remove 1 diamond helmet from arg-1's inventory
					chance of 40%:
						give 5 diamonds to arg-1

			else if arg 3 is "goldhelmet":
				if arg-1 has 1 golden helmet:
					remove 1 golden helmet from arg-1's inventory
					chance of 50%:
						give 5 gold ingot to arg-1

			else if arg 3 is "ironhelmet":
				if arg-1 has 1 iron helmet:
					remove 1 iron helmet from arg-1's inventory
					chance of 60%:
						give 5 iron ingot to arg-1

			else if arg 3 is "chainhelmet":
				if arg-1 has 1 chain helmet:
					remove 1 chain helmet from arg-1's inventory
					chance of 70%:
						give 5 iron ingot to arg-1

			else if arg 3 is "leatherhelmet":
				if arg-1 has 1 leather helmet:
					remove 1 leather helmet from arg-1's inventory
					chance of 80%:
						give 5 leather to arg-1

Tu auras besoin de TuSKe pour les GUI et SkStuff pour enlever les statiques affichées en-dessous des armes et des armures ^^

Et comme tu l'auras remarqué le code n'est pas complet mais tu as juste à copié/collé en remplaçant les valeurs ?

Modifié par Razo
  • J'aime 1
Posté(e)
il y a 3 minutes, Razo a dit :

Tqt j'ai déja fais un bout de liste qui pourrais vraiment t'aider dans tes "recherches":


options:
	name: Recycleur

on rightclick on villager:
	if event-entity's name contains "{@name}":
		cancel event
		make console execute command "/recy %player%"

command /recy <player> [<text>] [<text>]:
	permission: *
	trigger:
		if arg 2 isn't set:
			open virtual chest inventory with size 3 named "{@name}" to arg-1
			format gui slot 0, 1, 2, 3, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26 of arg-1 with 1 green glass named " " to do nothing
			format gui slot 4 of arg-1 with 1 2 named "{@name}" to do nothing
			format gui slot 9 of arg-1 with 1 diamond sword with no nbt named "§6Armes" with lore "§7Clique-ici pour accéder aux armes" to run console command "/recy %arg-1% weapon"
			format gui slot 10 of arg-1 with 1 diamond chestplate with no nbt named "§6Armures" with lore "§7Clique-ici pour accéder aux armures" to run console command "/recy %arg-1% armor"

		else if arg 2 is "weapon":
			if arg 3 isn't set:
				open virtual chest inventory with size 3 named "{@name} §6» Armes" to arg-1
				format gui slot 1, 2, 3, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26 of arg-1 with 1 green glass named " " to do nothing
				format gui slot 0 of arg-1 with 1 barrier named "§c« Retour" to run console command "/recy %arg-1%"
				format gui slot 4 of arg-1 with 1 diamond sword with no nbt named "§6Armes" to do nothing
				format gui slot 9 of arg-1 with 1 diamond sword with no nbt named "§aRecycler une §6épée en diamant §a?" to run console command "/recy %arg-1% weapon diamond"
				format gui slot 10 of arg-1 with 1 golden sword with no nbt named "§aRecycler une §6épée en or §a?" to run console command "/recy %arg-1% weapon gold"
				format gui slot 11 of arg-1 with 1 iron sword with no nbt named "§aRecycler une §6épée en fer §a?" to run console command "/recy %arg-1% weapon iron"
				format gui slot 12 of arg-1 with 1 stone sword with no nbt named "§aRecycler une §6épée en pierre §a?" to run console command "/recy %arg-1% weapon cobble"
				format gui slot 13 of arg-1 with 1 wooden sword with no nbt named "§aRecycler une §6épée en bois §a?" to run console command "/recy %arg-1% weapon wood"

			else if arg 3 is "diamond":
				if arg-1 has 1 diamond sword:
					remove 1 diamond sword from arg-1's inventory
					chance of 40%:
						give 2 diamonds to arg-1

			else if arg 3 is "gold":
				if arg-1 has 1 golden sword:
					remove 1 golden sword from arg-1's inventory
					chance of 50%:
						give 2 gold ingot to arg-1

			else if arg 3 is "iron":
				if arg-1 has 1 iron sword:
					remove 1 iron sword from arg-1's inventory
					chance of 60%:
						give 2 iron ingot to arg-1

			else if arg 3 is "cobble":
				if arg-1 has 1 stone sword:
					remove 1 stone sword from arg-1's inventory
					chance of 70%:
						give 2 cobblestone to arg-1

			else if arg 3 is "wood":
				if arg-1 has 1 wooden sword:
					remove 1 wooden sword from arg-1's inventory
					chance of 80%:
						give 2 oak planks to arg-1

		else if arg 2 is "armor":
			if arg 3 isn't set:
				open virtual chest inventory with size 6 named "{@name} §6» Armures" to arg-1
				format gui slot 1, 2, 3, 5, 6, 7, 8, 45, 46, 47, 48, 49, 50, 51, 52, 53 of arg-1 with 1 green glass named " " to do nothing
				format gui slot 0 of arg-1 with 1 barrier named "§c« Retour" to run console command "/recy %arg-1%"
				format gui slot 4 of arg-1 with 1 diamond chestplate with no nbt named "§6Armures" to do nothing
				format gui slot 9 of arg-1 with 1 diamond helmet with no nbt named "§aRecycler un §6casque en diamant §a?" to run console command "/recy %arg-1% armor diamondhelmet"
				format gui slot 10 of arg-1 with 1 golden helmet with no nbt named "§aRecycler une §6casque en or §a?" to run console command "/recy %arg-1% weapon goldhelmet"
				format gui slot 11 of arg-1 with 1 iron helmet with no nbt named "§aRecycler une §6casque en fer §a?" to run console command "/recy %arg-1% weapon ironhelmet"
				format gui slot 12 of arg-1 with 1 chain helmet with no nbt named "§aRecycler une §6casque en côte de maille §a?" to run console command "/recy %arg-1% weapon chainhelmet"
				format gui slot 13 of arg-1 with 1 leather helmet with no nbt named "§aRecycler une §6casque en cuir §a?" to run console command "/recy %arg-1% weapon leatherhelmet"

			else if arg 3 is "diamondhelmet":
				if arg-1 has 1 diamond helmet:
					remove 1 diamond helmet from arg-1's inventory
					chance of 40%:
						give 5 diamonds to arg-1

			else if arg 3 is "goldhelmet":
				if arg-1 has 1 golden helmet:
					remove 1 golden helmet from arg-1's inventory
					chance of 50%:
						give 5 gold ingot to arg-1

			else if arg 3 is "ironhelmet":
				if arg-1 has 1 iron helmet:
					remove 1 iron helmet from arg-1's inventory
					chance of 60%:
						give 5 iron ingot to arg-1

			else if arg 3 is "chainhelmet":
				if arg-1 has 1 chain helmet:
					remove 1 chain helmet from arg-1's inventory
					chance of 70%:
						give 5 iron ingot to arg-1

			else if arg 3 is "leatherhelmet":
				if arg-1 has 1 leather helmet:
					remove 1 leather helmet from arg-1's inventory
					chance of 80%:
						give 5 leather to arg-1

Tu auras besoin de TuSKe pour les GUI et SkStuff pour enlever les statiques affichées en-dessous des armes et des armures ^^

Et comme tu l'auras remarqué le code n'est pas complet mais tu as juste à copié/collé en remplaçant les valeurs ?

hey c'est ouff tout ce que tu as fais

je ne pense aps que ce soit ce que je voulais de base, mais je vais quand même l'essayer ça à l'air parfait ?

  • J'aime 1
Posté(e)

Merci ^^, bah en gros lors d'un clique-droit sur un pnj nommé "Recycleur" ça ouvre un GUI avec des catégories (là y'a "Armes" et "Armures"), et quand tu ouvres y'a les items dedans, psq faire un système pour trouver les items que le joueur à c'est un peu soulant et long et chiant pour rien, et en fonction de la rareté de l'objet, le pourcentage de chance qu'il récupère les items sont +/- élevés

Posté(e)

je viens de me rendre compte qu'il me manque SkStuff, mais que lorsque je lance le .jar que je viens d'installer (le SkStuff.jar) beh ça fait rien  ... ?

 

Posté(e)

Les trucs de list sont pas comptés comme des erreurs, là il reconnaît pas les ouvertures d'inventaires (gui) et 2 format slots, essaye de remplacer barrier par 166, mais je pense pas que ça change grand chose, et si les autres formats slots fonctionnent, je vois pas pourquoi les ouvertures d'inv. marchent pas étant donné qu'ils sont sur le même addon.

Installe skQuery Lime si tu peux, et ré-installe les dernières versions de skStuff et TuSKe

Posté(e)

Ok, d'ailleurs si tu peux enlève WildSkript mdr, il est tout pété et il peut faire buguer quelques trucs dans test skripts, et si tu le garde pour les crafts customs utilise des plugins, y'en a des très bon ^^

Posté(e) (modifié)

hey, sur le skript j'peux seulement l'ouvrir et faire les commandes, mais quand je clique sur le plastron ou l'épée ça me le garde dans ma souris, en gros j'peux le déplacer dans mon inventaire et le garder et ça fait rien en cliquant.

J'ai supprimé wildskript ?

Modifié par EniKing_
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.