REDox1248 Posté(e) le 21 avril 2018 Posté(e) le 21 avril 2018 Bonjour, je souhaiterais, si c'est possible, que quelqu'un m'aide: Je m'explique: Je souhaite faire un skywars. Il y a plusieurs map de skywars sur le même serveur. Pour un skywars j'ai donc besoin de generer des item aléatoire dans des coffres. Je suis tombé sur le code de Soufreur78: 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" Ce code est presque parfait, mais je ne peux l'utiliser car comme dit précédemment, j'ai plusieurs map sur le même serveur: Serais donc t-il possible que quelqu'un "améliore" ce skript affin que l'on puisse, selon dans quelle monde on est, stocker la position des coffres dans des variable différente. Pour ceux qui n'ont pas compris je résume tout: J'aimerais refill tout les coffres d'un monde en une commande (/refill <le nom de mon monde>), sachant que j'ai 12 mondes (6 map avec pour chacune une version solo et duo. je vous remercie d'avence car je ne sais pas du-tout comment m'y prendre, même si je me doute que sa va être TRÈS long. REDox
REDox1248 Posté(e) le 23 avril 2018 Auteur Posté(e) le 23 avril 2018 Up ;) @Soufreur78 Tu pense tu pourrait voir ça ? Je te mention parce que c'est toi qui l'a fait du coup... Merci d’avance !
Flynix Posté(e) le 23 avril 2018 Posté(e) le 23 avril 2018 (modifié) essaie de mettre ceci pour la commande /chest juste apres le trigger if world of player is "world": loop all players: if world of loop-player is "world": Modifié le 23 avril 2018 par Invité
lazerda456 Posté(e) le 23 avril 2018 Posté(e) le 23 avril 2018 (modifié) Pas du tout optimisé loop all players: . loop-player is in world "ton monde": . broadcast "test" (D'après de ce que j'ai compris) Modifié le 23 avril 2018 par Invité
Soufreur78 Posté(e) le 29 avril 2018 Posté(e) le 29 avril 2018 @REDox1248 Bonjour, tu veux toujours le code ? Si oui je te le fait rapidement
Flynix Posté(e) le 29 avril 2018 Posté(e) le 29 avril 2018 @REDox1248 Bonjour, tu veux toujours le code ? Si oui je te le fait rapidement Tu peux le faire ? S'il te plait. Ça m’intéresse aussi, et je pense qu'il le veut toujour
Soufreur78 Posté(e) le 29 avril 2018 Posté(e) le 29 avril 2018 (modifié) Tu peux le faire ? S'il te plait. Ça m’intéresse aussi, et je pense qu'il le veut toujour Je te le fais rapidement :) Modifié le 29 avril 2018 par Soufreur78
Soufreur78 Posté(e) le 29 avril 2018 Posté(e) le 29 avril 2018 Voila le code, il permet donc de faire plusieurs listes de coffre :) [spoiler=Code] 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>] [<text>]: permission: chest.use trigger: if arg 1 is not set: message "&8&m&l---------------------------------" message "&9&l&nCommandes :" message "" message "&6● &e/chest add <map> &f Ajouter un coffre" message "&6● &e/chest remove <map> &f Supprimer un coffre" message "&6● &e/chest clear <map> &f Supprimer tous les coffres" message "&6● &e/chest refill <map> &f Refill les coffres" message "&8&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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest clear <nom de la map>" else: clear {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres enregistrés pour la map &9%arg 2%" if arg 1 is "add": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest add <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%location of targeted block%": message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste" else: add location of targeted block to {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" else: message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre" if arg 1 is "remove": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest remove <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%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.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" remove location of targeted block from {Chest.location.%arg 2%::*} else: 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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest refill <nom de la map>" else: if {Chest.location.%arg 2%::*} is not set: message "&8[&a&lChest&8] &c➡ Il n'y aucun coffre enregistré dans la map &9%arg 2%" else: loop {Chest.location.%arg 2%::*}: set {_slot::*} to "" loop 27 times: add loop-number to {_number::*} clear inventory of block at loop-value if block at loop-value is not chest: set block at loop-value to chest 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::*} remove {_slot} from {_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::*}% &ecoffres de la map &9%arg 2% &eont été refill" 1
Flynix Posté(e) le 29 avril 2018 Posté(e) le 29 avril 2018 Voila le code, il permet donc de faire plusieurs listes de coffre :) [spoiler=Code] 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>] [<text>]: permission: chest.use trigger: if arg 1 is not set: message "&8&m&l---------------------------------" message "&9&l&nCommandes :" message "" message "&6● &e/chest add <map> &f Ajouter un coffre" message "&6● &e/chest remove <map> &f Supprimer un coffre" message "&6● &e/chest clear <map> &f Supprimer tous les coffres" message "&6● &e/chest refill <map> &f Refill les coffres" message "&8&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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest clear <nom de la map>" else: clear {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres enregistrés pour la map &9%arg 2%" if arg 1 is "add": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest add <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%location of targeted block%": message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste" else: add location of targeted block to {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" else: message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre" if arg 1 is "remove": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest remove <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%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.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" remove location of targeted block from {Chest.location.%arg 2%::*} else: 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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest refill <nom de la map>" else: if {Chest.location.%arg 2%::*} is not set: message "&8[&a&lChest&8] &c➡ Il n'y aucun coffre enregistré dans la map &9%arg 2%" else: loop {Chest.location.%arg 2%::*}: set {_slot::*} to "" loop 27 times: add loop-number to {_number::*} clear inventory of block at loop-value if block at loop-value is not chest: set block at loop-value to chest 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::*} remove {_slot} from {_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::*}% &ecoffres de la map &9%arg 2% &eont été refill" Merci ^^
REDox1248 Posté(e) le 29 avril 2018 Auteur Posté(e) le 29 avril 2018 Voila le code, il permet donc de faire plusieurs listes de coffre :) [spoiler=Code] 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>] [<text>]: permission: chest.use trigger: if arg 1 is not set: message "&8&m&l---------------------------------" message "&9&l&nCommandes :" message "" message "&6● &e/chest add <map> &f Ajouter un coffre" message "&6● &e/chest remove <map> &f Supprimer un coffre" message "&6● &e/chest clear <map> &f Supprimer tous les coffres" message "&6● &e/chest refill <map> &f Refill les coffres" message "&8&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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest clear <nom de la map>" else: clear {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez supprimé tous les coffres enregistrés pour la map &9%arg 2%" if arg 1 is "add": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest add <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%location of targeted block%": message "&8[&a&lChest&8] &c➡ Le coffre est déjà dans la liste" else: add location of targeted block to {Chest.location.%arg 2%::*} message "&8[&a&lChest&8] &a➡ &eVous avez bien ajouté ce coffre, il y a maintenant &a%size of {Chest.location.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" else: message "&8[&a&lChest&8] &c➡ Vous devez cibler un coffre" if arg 1 is "remove": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest remove <nom de la map>" else: if targeted block is a chest: if "%{Chest.location.%arg 2%::*}%" contain "%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.%arg 2%::*}% &ecoffres dans la map &9%arg 2%" remove location of targeted block from {Chest.location.%arg 2%::*} else: 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": if arg 2 is not set: message "&8[&a&lChest&8] &c/chest refill <nom de la map>" else: if {Chest.location.%arg 2%::*} is not set: message "&8[&a&lChest&8] &c➡ Il n'y aucun coffre enregistré dans la map &9%arg 2%" else: loop {Chest.location.%arg 2%::*}: set {_slot::*} to "" loop 27 times: add loop-number to {_number::*} clear inventory of block at loop-value if block at loop-value is not chest: set block at loop-value to chest 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::*} remove {_slot} from {_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::*}% &ecoffres de la map &9%arg 2% &eont été refill" Merci beaucoup, tu me sauve la vie xD
REDox1248 Posté(e) le 29 avril 2018 Auteur Posté(e) le 29 avril 2018 Juste petite question, je cherche a faire un skript de reset de map, comme dans cette vidéo: . Le problème (toujours le même) c'est que j'ai plusieurs monde. Quelqu'un pourrait le "convertir" /le rendre compatible pour plusieurs monde a la manière du skript pour refill les coffres (possibilité de reset plusieurs monde séparément, d'activé le mod "no modif" sur seulement un monde (voir vidéo) ) Merci beaucoup a celui qui arriverait a me faire sa.
Vengelis_ Posté(e) le 30 avril 2018 Posté(e) le 30 avril 2018 Juste petite question, je cherche a faire un skript de reset de map, comme dans cette vidéo: . Le problème (toujours le même) c'est que j'ai plusieurs monde. Quelqu'un pourrait le "convertir" /le rendre compatible pour plusieurs monde a la manière du skript pour refill les coffres (possibilité de reset plusieurs monde séparément, d'activé le mod "no modif" sur seulement un monde (voir vidéo) ) Merci beaucoup a celui qui arriverait a me faire sa. Une problématique par poste. je lock donc refais-en un. Merci
Messages recommandés