i was wondering if my skirpt was good ?

  • Welcome to skUnity!

    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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

azea1688

Member
Oct 11, 2023
4
0
1
19
on drop:
if name of player's tool is "":
if player doesn't have permission "recycleredits":
cancel event
else:
stop
on inventory click:
if name of player's tool is "":
if player doesn't have permission "recycleredits":
cancel event
else:
stop
on right click:
if right clicked block is yellow_shulker_box:
set {_recyclerid} to location of event-block
cancel event
open virtual chest inventory with size 3 named "&2 recycler" to player
loop 9 times:
set slot (loop-value - 1) of player's current inventory to light gray stained glass pane named ""
loop 9 times:
set slot (loop-value + 17) of player's current inventory to light gray stained glass pane named ""
set slot 22 of player's current inventory to red stained glass pane named "&4off"
set slot 10 of player's current inventory to {data::%{_recyclerid}%::slot10}
set slot 11 of player's current inventory to {data::%{_recyclerid}%::slot11}
set slot 12 of player's current inventory to {data::%{_recyclerid}%::slot12}
set slot 14 of player's current inventory to {data::%{_recyclerid}%::slot14}
set slot 15 of player's current inventory to {data::%{_recyclerid}%::slot15}
set slot 16 of player's current inventory to {data::%{_recyclerid}%::slot16}
on inventory close:
if name of event-inventory is "&2 recycler":
set {_recyclerid} to location of event-block
set {data::%{_recyclerid}%::slot10} to slot 10 of event-inventory
set {data::%{_recyclerid}%::slot11} to slot 11 of event-inventory
set {data::%{_recyclerid}%::slot12} to slot 12 of event-inventory
set {data::%{_recyclerid}%::slot14} to slot 14 of event-inventory
set {data::%{_recyclerid}%::slot15} to slot 15 of event-inventory
set {data::%{_recyclerid}%::slot16} to slot 16 of event-inventory
on inventory click:
if clicked slot is 22:
if name of event-inventory is "&2 recycler":
if clicked item is red stained glass pane named "&4off":
cancel event
set slot 22 of event-inventory to lime stained glass pane named "&2on"
if slot 10 of event-inventory is not air or slot 11 of event-inventory is not air or slot 12 of event-inventory is not air:
loop all items in event-inventory:
if loop-item is "insert item here": #copy that for more item
while amount of loop-item > 0:
if slot 14 of event-inventory is air:
set slot 14 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop item
else if slot 15 of event-inventory is air:
set slot 15 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop-item
else if slot 16 of event-inventory is air:
set slot 16 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop-item
else:
drop loop-item at location of player
remove 1 iron_chestplate from loop-item
play sound "random.anvil_use" at player with volume 1 and pitch 1
wait 3 second
if slot 10 of event-inventory is air and slot 11 of event-inventory is air and slot 12 of event-inventory is air:
set slot 22 of player's current inventory to red stained glass pane named "&4off"
 
on drop:
if name of player's tool is "":
if player doesn't have permission "recycleredits":
cancel event
else:
stop
on inventory click:
if name of player's tool is "":
if player doesn't have permission "recycleredits":
cancel event
else:
stop
on right click:
if right clicked block is yellow_shulker_box:
set {_recyclerid} to location of event-block
cancel event
open virtual chest inventory with size 3 named "&2 recycler" to player
loop 9 times:
set slot (loop-value - 1) of player's current inventory to light gray stained glass pane named ""
loop 9 times:
set slot (loop-value + 17) of player's current inventory to light gray stained glass pane named ""
set slot 22 of player's current inventory to red stained glass pane named "&4off"
set slot 10 of player's current inventory to {data::%{_recyclerid}%::slot10}
set slot 11 of player's current inventory to {data::%{_recyclerid}%::slot11}
set slot 12 of player's current inventory to {data::%{_recyclerid}%::slot12}
set slot 14 of player's current inventory to {data::%{_recyclerid}%::slot14}
set slot 15 of player's current inventory to {data::%{_recyclerid}%::slot15}
set slot 16 of player's current inventory to {data::%{_recyclerid}%::slot16}
on inventory close:
if name of event-inventory is "&2 recycler":
set {_recyclerid} to location of event-block
set {data::%{_recyclerid}%::slot10} to slot 10 of event-inventory
set {data::%{_recyclerid}%::slot11} to slot 11 of event-inventory
set {data::%{_recyclerid}%::slot12} to slot 12 of event-inventory
set {data::%{_recyclerid}%::slot14} to slot 14 of event-inventory
set {data::%{_recyclerid}%::slot15} to slot 15 of event-inventory
set {data::%{_recyclerid}%::slot16} to slot 16 of event-inventory
on inventory click:
if clicked slot is 22:
if name of event-inventory is "&2 recycler":
if clicked item is red stained glass pane named "&4off":
cancel event
set slot 22 of event-inventory to lime stained glass pane named "&2on"
if slot 10 of event-inventory is not air or slot 11 of event-inventory is not air or slot 12 of event-inventory is not air:
loop all items in event-inventory:
if loop-item is "insert item here": #copy that for more item
while amount of loop-item > 0:
if slot 14 of event-inventory is air:
set slot 14 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop item
else if slot 15 of event-inventory is air:
set slot 15 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop-item
else if slot 16 of event-inventory is air:
set slot 16 of event-inventory to 1 of loop-item
remove 1 "insert item here" from loop-item
else:
drop loop-item at location of player
remove 1 iron_chestplate from loop-item
play sound "random.anvil_use" at player with volume 1 and pitch 1
wait 3 second
if slot 10 of event-inventory is air and slot 11 of event-inventory is air and slot 12 of event-inventory is air:
set slot 22 of player's current inventory to red stained glass pane named "&4off"
Just skimming through your Skript, I can tell you it's okay. It's decent for a start, but not optimized. In my opinion and through past experiences in coding GUIs, I found that you want to try and use functions if you can for them, especially if they have the same size/similar contents. This will save you a lot of space. Shorter code is always best! You can also utilize loops to make some parts of your current code shorter. I've provided examples of using a GUI for a function and looping below.

Code:
command test:
   trigger:
      set {_n} to 10
      loop 6 times:
         send "Number is now: %{_n}%"
         add 1 to {_n}

command opengui:
   trigger:
      customgui(player, diamond, "&9This is a diamond!")

function customgui(p: player, i: item, n: text) :: inventory:
    set {_g} to a new chest inventory with 1 row named "&bExample"
    set slot 4 of {_g} to {_i} named "%{_n}%" # Sets up an item with a name
    set slot 0 of {_g} to barrier named "&c&lx &cClose" # A close button
    open {_g} to {_p}
References for the examples I used:
Functions and Looping.