Skript: 2.2-dev25, Spigot 1.8.8
Everything works fine, if I execute the command /calcola 2+2, it returns "4". But if I try to evaluate 2+2 by clicking "2", "+", "2" in the GUI, the variable returns <none>.
Here is the code, you can take how much time you need, no problems!
[doublepost=1526228656,1526169385][/doublepost]Fixed, the error was on
, sorry everyone. I'm idiot 
Everything works fine, if I execute the command /calcola 2+2, it returns "4". But if I try to evaluate 2+2 by clicking "2", "+", "2" in the GUI, the variable returns <none>.
Here is the code, you can take how much time you need, no problems!
code_language.skript:
#!Options
options:
perm: calculator.use
noperm: &cNon ne hai il permesso!
prefix: &8 • &7&lCALCOLATRICE &8• &7
#!Code down here, 1st part is "/calcola 2+2", that works fine. 2nd part is the one that presents problems
command /calcola [<text>]:
permission: {@perm}
permission message: {@noperm}
trigger:
play "LEVEL_UP" to player at volume 100
arg 1 is set:
set {numbers::%player%} to arg 1
evaluate "set {_calc} to %{numbers::%player%}%"
{_calc} is not set:
send player title "&cErrore!" with subtitle "&7L'espressione non è scritta correttamente!" for 3.3 seconds
clear {numbers::%player%}
stop
send player title "&7Il risultato di &c%{numbers::%player%}% &7è" with subtitle "&7. . . . ." for 3 seconds
wait 2.5 seconds
send player title "&c%{_calc}%&7!" with subtitle "" for 3.3 seconds
clear {numbers::%player%}
stop
arg 1 is not set
open chest with 6 rows named "{@prefix}" to player
set {_num} to 0
loop 9 times:
set slot {_num} of player's current inventory to dark gray stained glass pane named " "
add 1 to {_num}
set {_num} to 45
loop 10 times:
set slot {_num} of player's current inventory to dark gray stained glass pane named " "
add 1 to {_num}
set slot 1 of player's current inventory to light blue stained glass pane named " "
set slot 7 of player's current inventory to light blue stained glass pane named " "
set slot 46 of player's current inventory to light blue stained glass pane named " "
set slot 52 of player's current inventory to light blue stained glass pane named " "
set slot 11 of player's current inventory to stone button named "&c1"
set slot 12 of player's current inventory to stone button named "&c2"
set slot 13 of player's current inventory to stone button named "&c3"
set slot 20 of player's current inventory to stone button named "&c4"
set slot 21 of player's current inventory to stone button named "&c5"
set slot 22 of player's current inventory to stone button named "&c6"
set slot 29 of player's current inventory to stone button named "&c7"
set slot 30 of player's current inventory to stone button named "&c8"
set slot 31 of player's current inventory to stone button named "&c9"
set slot 38 of player's current inventory to stone button named "&c0"
set slot 15 of player's current inventory to blue stained clay named "&c+"
set slot 16 of player's current inventory to light blue stained clay named "&c-"
set slot 24 of player's current inventory to green stained clay named "&c*"
set slot 25 of player's current inventory to light green stained clay named "&c/"
set slot 36 of player's current inventory to barrier named "&cReset"
set slot 42 of player's current inventory to emerald named "&7&lScegli prima dei numeri!"
set slot 43 of player's current inventory to emerald named "&7&lScegli prima dei numeri!"
on inventory click:
name of player's current inventory = "{@prefix}":
cancel event
{numbers::%player%} is not set:
set {numbers::%player%} to ""
clicked item = a stone button or blue stained clay or light blue stained clay or green stained clay or light green stained clay:
set {numbers::%player%} to "%{numbers::%player%}%%uncoloured name of clicked item%"
set slot 42 of player's current inventory to emerald named "&f&lCalcola!" with lore "&c%{numbers::%player%}%"
set slot 43 of player's current inventory to emerald named "&f&lCalcola!" with lore "&c%{numbers::%player%}%"
clicked item = barrier:
"%uncoloured name of clicked item%" = "Reset":
clear {numbers::%player%}
set slot 42 of player's current inventory to emerald named "&7&lScegli prima dei numeri!"
set slot 43 of player's current inventory to emerald named "&7&lScegli prima dei numeri!"
clicked item = an emerald:
"%uncoloured name of clicked item%" = "Calcola!":
wait 2 ticks
close player's inventory
evaluate "set {_calc} to %{numbers::%player%}%"
{_calc} is not set:
send player title "&cErrore!" with subtitle "&7L'espressione non è scritta correttamente!" for 3.3 seconds
clear {numbers::%player%}
stop
send player title "&7Il risultato di &c%{numbers::%player%}% &7è" with subtitle "&7. . . . ." for 3 seconds
wait 2.5 seconds
send player title "&c%{_calc}%&7!" with subtitle "" for 3.3 seconds
clear {numbers::%player%}
stop
on inventory close:
name of player's current inventory is "{@prefix}"
clear {numbers::%player%}
stop
code_language.skript:
on inventory close:
clear {numbers::%player%}