EniKing_ Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 (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é le 12 août 2018 par EniKing_
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 Ton npc vient du jeu ? Ceux qu'on trouve dans les villages ?
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 J'te fais ça ^^, pour me faciliter la tâche tu pourrais me faire une liste ?
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 (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é le 12 août 2018 par Razo 1
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 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 ? 1
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 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
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 ok merci de l'info ça m'a l'air bien. par contre il y a 5 erreurs, j'vais voir si j'ai les plugins
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 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 ... ?
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 mdr faut pas le lancer faut le mettre dans le dossier plugin, et en 1.12 c'est sûr que ça fonctionne
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 (modifié) ah x) Modifié le 12 août 2018 par EniKing_
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 (modifié) merde ... en fait j'ai déjà les deux plugins, je suis censé faire comment là ? x) Modifié le 12 août 2018 par EniKing_
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 Je sais pas, donne moi les erreurs, et au faite les doubles posts sont interdits x), tu peux edit tes messages
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 (modifié) mince :x merci du conseil les erreurs, à lire dans l'ordre croissant des nombres: Modifié le 12 août 2018 par EniKing_
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 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
EniKing_ Posté(e) le 12 août 2018 Auteur Posté(e) le 12 août 2018 j'suis dessus, je travaille sur les versions y'a des couilles partout, j'te dis des que mes versions sont à jour, vérifie si j''edit pas ?
noftaly Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 Oui on est en train de l'aider discord a tout mettre à jour ^^
Razo Posté(e) le 12 août 2018 Posté(e) le 12 août 2018 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 ^^
EniKing_ Posté(e) le 13 août 2018 Auteur Posté(e) le 13 août 2018 (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é le 13 août 2018 par EniKing_
Razo Posté(e) le 13 août 2018 Posté(e) le 13 août 2018 C'est "normal" c'est ces items qui produisent ces erreurs. Télécharge la dernière version de Skript ici : https://github.com/SkriptLang/Skript/releases Il faut cliquer sur Skript.jar
EniKing_ Posté(e) le 13 août 2018 Auteur Posté(e) le 13 août 2018 oui sauf que j'ai tout mis à jour hier, et ça bug quand meme ?
Messages recommandés