Hello, I'm trying to do a shop gui. It always ads one more to the loop-value, so format gui slot 0 of player with 1 grass, next is format gui slot 1 of player with 2 grass, etc.
But.. How to do this? My code is not working {_a} is 4 because I manually added 4 slots
There's an error with that /getgrass too.
[20:38:58 ERROR]: There's no loop that matches 'loop-number-3 grass with name "&eGrass - %{_a}%"'
[20:38:58 ERROR]: There's no loop that matches 'loop-number grass'
So what I want is fill up the GUI with always +1 grass (Sorry for my bad English)
[doublepost=1538247065,1538246544][/doublepost]I fixed the /getgrass, but the other thing is still not working:c
[doublepost=1538248352][/doublepost]Fixed the another thing too! If someone has this problem, my code:
But.. How to do this? My code is not working {_a} is 4 because I manually added 4 slots
code_language.skript:
loop 64 - {_a} times:
loop integers between {_a} - 1 and {_b}:
set {_a} to {_a} + 1
set {_b} to {_a} - 1
set {_c} to 64 - {_a}
loop {_c} times:
set slot loop-number-2 of player with loop-number-3 grass with name "&eGrass - %{_a}%" to run player command "/getgrass %{_a}%"
There's an error with that /getgrass too.
code_language.skript:
command /getgrass <Text>:
trigger:
set {_num} to arg-1 parsed as a number
loop integers between {_num} - 1 and {_num} + 1:
give loop-number grass to player
set {_asd} to loop-number * 10
remove {_asd} from player's balance
[20:38:58 ERROR]: There's no loop that matches 'loop-number-3 grass with name "&eGrass - %{_a}%"'
[20:38:58 ERROR]: There's no loop that matches 'loop-number grass'
So what I want is fill up the GUI with always +1 grass (Sorry for my bad English)
[doublepost=1538247065,1538246544][/doublepost]I fixed the /getgrass, but the other thing is still not working:c
[doublepost=1538248352][/doublepost]Fixed the another thing too! If someone has this problem, my code:
code_language.skript:
command /guigrass:
trigger:
open virtual chest inventory with size 8 with name "&6Shop - Blocks - Grass" to player
wait 1 tick
format gui slot 0 of player with 1 grass with name "&eGrass - 1" to run player command "/getgrass 1"
set {_a} to 0
while {_a} is less than 64:
set {_a} to {_a} + 1
set {_b} to {_a} - 1
loop 64 times:
format gui slot {_b} of player with {_a} of grass with name "&eGrass - %{_a}%" to run player command "/getgrass %{_a}%"
command /getgrass <Number>:
trigger:
give arg-1 of grass to player
set {_asd} to arg 1 * 10
remove {_asd} from player's balance