Version de Minecraft : 1.18.2
Version de Skript : 2.6.1
Addons utilisés: SkQuery, SkRayFall, Skript-Gui, WolfSk2
Type du skript : Shop Gui
Bonjour,
En version 1.16 avec Tuske, je m'étais lancer à créer un shop avec la possibilité de choisir un nombre donné de l'item désiré grâce à la "function", ce dernier fonctionnait parfaitement. Or en migrant vers la version 1.18.2 de Minecraft, Tuske n'étant plus à jour, j'utilise désormais Skript-Gui qui est pratiquement identique.
Maintenant lorsque je reload le skript cela m'affiche le message d'erreur ci-dessous. Chose que je n'arrive pas à résoudre malgré toutes mes recherches sur internet. Peut-être me manque t-il un addon ?
Voici mon skript :
function buycobblestone(p: player, operation: string):
set {_amount} to amount of cobblestone in {_p}'s current inventory
if {_operation} is "add":
add 1 to {_amount}
else if {_operation} is "remove":
if {_amount} is more than 1:
remove 1 from {_amount}
else:
set {_cost} to {_amount}*{@a_cobblestone}
if {_p}'s balance is less than {_cost}:
send "&8» &cVous n'avez pas assez d'argent !" to {_p}
else:
if {_p} has enough space for {_amount} of cobblestone:
remove {_cost} from {_p}'s balance
give {_amount} of cobblestone to {_p}
send "&8» &a%{_cost}%&a$ ont été débité de votre compte." to {_p}
else:
send "&8» &cVotre inventaire est plein !" to {_p}
close {_p}'s inventory
stop
command §sBlock:
trigger:
create new gui with virtual chest inventory named " &8--==[&e&lBlocs&8]==--" with 6 rows:
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 45, 46, 47, 48, 49, 50, 51, 52 with cyan glass pane named " "
format gui slot 53 with red glass pane named "&cRetour":
make player execute command "shop"
format gui slot 9 with cobblestone with lore "&7Prix d'achat: &c{@a_cobblestone}$" and "&7Prix de vente: &a{@v_cobblestone}$" and "&9Cliquez avec la &emolette &9pour tout vendre.":
create new gui with virtual chest inventory named "test" with 5 rows:
set {_amount} to amount of cobblestone in player's current inventory
set {_cost} to {_amount}*{@a_cobblestone}
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 39, 40, 41, 43, 44, 45 with cyan glass pane named " "
format gui slot 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 32, 33, 34, 35 with gray glass pane named " "
format gui slot 38 with emerald named "&aValider"
format gui slot 42 with barrier named "&cAnnuler":
make player execute command "§sBlock"
format gui slot 19 with lime glass pane named "&a+1":
function buycobblestone(player, "add")
format gui slot 13 with {_amount} of cobblestone with lore "&aPrix &7:&a %{_cost}%&a$":
function buycobblestone(player, "pay")
format gui slot 25 with red glass pane named "&c-1":
function buycobblestone(player, "remove")
format gui slot 31 with 64 lime glass named "&eAchat par stacks"
open last created gui to player
open last created gui to player