Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
You can always check out skUnity Downloads for downloads and any other information about Skript!
loop alphabetical order of {_var::*}: # TuSKe addon needed
send "%loop-object%"
for alphabet
code_language.skript:loop alphabetical order of {_var::*}: # TuSKe addon needed send "%loop-object%"
command /hats2:
trigger:
open chest with 6 rows named "&bHats 2" to player
wait 3 ticks
format slot 0 of player with blue stained glass pane named "&9Sup" to be unstealable
format slot 9 of player with blue stained glass pane named "&9Sup" to be unstealable
format slot 18 of player with blue stained glass pane named "&9JrSup" to be unstealable
format slot 27 of player with yellow stained glass pane named "&eH-Build" to be unstealable
format slot 36 of player with yellow stained glass pane named "&eBuild" to be unstealable
format slot 49 of player with emerald named "&fSeite 2/3" to be unstealable
format slot 45 of player with slimeball named "&cZurück" to run [execute player command "/extras"]
format slot 52 of player with arrow named "&7Vorherige Seite" to run [execute player command "/hats"]
format slot 53 of player with arrow named "&7Nächste Seite" to run [execute player command "/hats3"]
A way to achieve the first part could be to loop through the slots until you find an empty slot.
As for the second part, I don't believe Skript has a built in alphabetical sorting, so you'd have to code and implement your own algorithm.
Can you give me an example pls?![]()
open chest with 6 rows named "Double Chest" to player
# looping all slots; assuming double chest ^
loop integers between 0 and 53:
# is the item in this slot is air
if "%slot loop-integer of player's current inventory%" is "air":
# do stuff
message "test" to player
code_language.skript:open chest with 6 rows named "Double Chest" to player # looping all slots; assuming double chest ^ loop integers between 0 and 53: # is the item in this slot is air if "%slot loop-integer of player's current inventory%" is "air": # do stuff message "test" to player
command /hatstest2:
trigger:
open chest with 6 rows named "Double Chest" to player
# looping all slots; assuming double chest ^
loop integers between 0 and 53:
# is the item in this slot is air
if "%slot loop-integer of player's current inventory%" is "air":
if player has permission "lobby.head.fridioushd":
wait 3 ticks
format slot %slot loop-integer of player's current inventory% of player with arrow named "&7Nächste Seite" to run [execute player command "/hats"]
[15:17:04 INFO]: [Skript] Reloading lobby.sk...
[15:17:04 INFO]: Lobby wurde deaktiviert
[15:17:04 INFO]: Lobby wurde aktiviert
[15:17:06 ERROR]: '"/hats"]' is not a text (lobby.sk, line 315: format slot %slot loop-integer of player's current inventory% of player with arrow named "&7Nõchste Seite" to run [execute player command "/hats"]')
[15:17:06 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!
code_language.skript:command /hatstest2: trigger: open chest with 6 rows named "Double Chest" to player # looping all slots; assuming double chest ^ loop integers between 0 and 53: # is the item in this slot is air if "%slot loop-integer of player's current inventory%" is "air": if player has permission "lobby.head.fridioushd": wait 3 ticks format slot %slot loop-integer of player's current inventory% of player with arrow named "&7Nächste Seite" to run [execute player command "/hats"]
Can you say what is wrong, because if i execute this command there is a Error:
And if I open the gui with the command there is no item in it.code_language.skript:[15:17:04 INFO]: [Skript] Reloading lobby.sk... [15:17:04 INFO]: Lobby wurde deaktiviert [15:17:04 INFO]: Lobby wurde aktiviert [15:17:06 ERROR]: '"/hats"]' is not a text (lobby.sk, line 315: format slot %slot loop-integer of player's current inventory% of player with arrow named "&7Nõchste Seite" to run [execute player command "/hats"]') [15:17:06 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!
%slot loop-integer of player's current inventory%
The codeproduces the name of the item of that slot. Replace that with just "loop-integer"code_language.skript:%slot loop-integer of player's current inventory%
Can you send me the code with that because i don't understand it
I am from Germany and i am not the best in english sorry![]()
command /hatstest2:
trigger:
open chest with 6 rows named "Double Chest" to player
# looping all slots; assuming double chest ^
loop integers between 0 and 53:
# is the item in this slot is air
if "%slot loop-integer of player's current inventory%" is "air":
if player has permission "lobby.head.fridioushd":
wait 3 ticks
format slot loop-integer of player with arrow named "&7Nächste Seite" to run [execute player command "/hats"]
code_language.skript:command /hatstest2: trigger: open chest with 6 rows named "Double Chest" to player # looping all slots; assuming double chest ^ loop integers between 0 and 53: # is the item in this slot is air if "%slot loop-integer of player's current inventory%" is "air": if player has permission "lobby.head.fridioushd": wait 3 ticks format slot loop-integer of player with arrow named "&7Nächste Seite" to run [execute player command "/hats"]
Hmm; perhaps try replacing the formate line with this:Thank you but this item is not in the inventory
set slot loop-integer of player's current inventory to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
Hmm; perhaps try replacing the formate line with this:
code_language.skript:set slot loop-integer of player's current inventory to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
[Skript] Reloading lobby.sk...
[15:49:18 INFO]: Lobby wurde deaktiviert
[15:49:18 INFO]: Lobby wurde aktiviert
[15:49:20 ERROR]: 'player with arrow named "&7Nõchste Seite"' is not an entity type (lobby.sk, line 314: set slot loop-integer of player with arrow named "&7Nõchste Seite" to run [execute player command "/hats"]')
[15:49:20 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!
You need to replace "with arrow" to "to arrow".
And in german
Mache aus dem "with arrow" ein "to arrow" dann sollte es gehen.
command /hatstest2:
trigger:
open chest with 6 rows named "Double Chest" to player
# looping all slots; assuming double chest ^
loop integers between 0 and 53:
# is the item in this slot is air
if "%slot loop-integer of player's current inventory%" is "air":
wait 10 ticks
set slot loop-integer of player to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
[16:02:54 INFO]: [Skript] Reloading lobby.sk...
[16:02:54 INFO]: Lobby wurde deaktiviert
[16:02:54 INFO]: Lobby wurde aktiviert
[16:02:56 ERROR]: '[execute player command "/hats"]' is not a text (lobby.sk, line 314: set slot loop-integer of player to arrow named "&7Nõchste Seite" to run [execute player command "/hats"]')
[16:02:56 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!
format slot loop-integer of player's current inventory to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
Natürlich habs gerade gesehen
Ändere die "set slot" Zeile zu dieser
code_language.skript:format slot loop-integer of player's current inventory to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
Denn so etwas wie "run" gehört/funktioniert hinter
set slot nicht.
[16:11:26 INFO]: [Skript] Reloading lobby.sk...
[16:11:26 INFO]: Lobby wurde deaktiviert
[16:11:26 INFO]: Lobby wurde aktiviert
[16:11:29 ERROR]: '"/hats"]' is not a text (lobby.sk, line 314: format slot loop-integer of player's current inventory to arrow named "&7Nõchste Seite" to run [execute player command "/hats"]')
[16:11:29 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!
command /hatstest2:
trigger:
open chest with 6 rows named "Double Chest" to player
# looping all slots; assuming double chest ^
loop integers between 0 and 53:
# is the item in this slot is air
if "%slot loop-integer of player's current inventory%" is "air":
wait 10 ticks
format slot loop-integer of player's current inventory to arrow named "&7Nächste Seite" to run [execute player command "/hats"]
format slot loop-integer of player's current inventory with arrow named "&7Nächste Seite" to run [make player execute command "/hats"]
[16:22:14 INFO]: [Skript] Reloading lobby.sk...
[16:22:14 INFO]: Lobby wurde deaktiviert
[16:22:14 INFO]: Lobby wurde aktiviert
[16:22:16 ERROR]: '"&7Nõchste Seite" to run [make player execute [SIZE=16px]command "/hats"]' is not a text (lobby.sk, line 314: format slot loop-integer of player's current inventory with arrow named "&7Nõchste Seite" to run [make player execute [SIZE=16px]command "/hats"]')
[16:22:16 INFO]: [Skript] Encountered 1 error while reloading lobby.sk!