I've only been learning skript for around a week and learnt to do meta data tag to open a gui. Yesterday I learnt of 'open chest with _ rows named "_" to player and format gui slot. If I make a while to count up to 53 and then set slot to the variable counting upwards it sets all the slots to the item. As you can see I need it so if player has permission it shows hopper if they don't it shows barrier. I I tried doing:
if player has permission "%{Test::%{_count}%}%.permission":
but this sets the slots to nothing?
Below is the meta data tag inventory slots I set up which as you can see would be 4 lines per slot meaning a double chest would have 216 lines. Also below is the way I tried to set the variable to count upwards and set the slots depending on what number the variable is set to at the time.
Original meta data slots
if player has permission "%{Test::1}%.permission":
set slot 1 of metadata tag "Test" of player to hopper named "&f1. Test"
if player doesn't have permission "%{_Test::1}%.permission":
set slot 1 of metadata tag "Tag59" of player to barrier named "&f1. Test"
New attempted slots
open chest with 6 rows named "Test" to player
set {_i} to 1
while {_i} is less than 54:
set {_ii} to {_i}
add 1 to {_i}
if player has permission "%{Test::%{_ii}%}%.permission":
format gui slot {_ii} of player with hopper named "&f1. Test"
else:
format gui slot {_ii} of player with barrier named "&f1. Test"
If I remove the if and else and barrier line it will set all the needed slots to the hopper, when I add needed permissions it no longer works.
I apologise for the lack of structure to this post, I'm not sure how to set it up more neatly. I appreciate any help I can get.
if player has permission "%{Test::%{_count}%}%.permission":
but this sets the slots to nothing?
Below is the meta data tag inventory slots I set up which as you can see would be 4 lines per slot meaning a double chest would have 216 lines. Also below is the way I tried to set the variable to count upwards and set the slots depending on what number the variable is set to at the time.
Original meta data slots
if player has permission "%{Test::1}%.permission":
set slot 1 of metadata tag "Test" of player to hopper named "&f1. Test"
if player doesn't have permission "%{_Test::1}%.permission":
set slot 1 of metadata tag "Tag59" of player to barrier named "&f1. Test"
New attempted slots
open chest with 6 rows named "Test" to player
set {_i} to 1
while {_i} is less than 54:
set {_ii} to {_i}
add 1 to {_i}
if player has permission "%{Test::%{_ii}%}%.permission":
format gui slot {_ii} of player with hopper named "&f1. Test"
else:
format gui slot {_ii} of player with barrier named "&f1. Test"
If I remove the if and else and barrier line it will set all the needed slots to the hopper, when I add needed permissions it no longer works.
I apologise for the lack of structure to this post, I'm not sure how to set it up more neatly. I appreciate any help I can get.