Resource icon

API Shop-Gui-API 1.0.0

  • 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!

Supported Minecraft Versions
  1. 1.13
  2. 1.14
VmC4Hxr.png

Shop-Gui-Api is a simple solution to setting up shops. Rather than writing out crazy amounts of lines, you simply just need to write 1 line per shop item in your GUI

REQUIRES:
- Skript (Tested with Bensku's fork - 2.3Beta4)
- Skript-Mirror (Tested with 1.0.0)
- Tuske (Tested with TuskePikachuPatch3)
- Vault+Economy (Its a shop after all)

HOW TO INSTALL:
- Just simply throw this in your scripts folder (plugins/Skript/scripts/)
- It needs to load before any script that is using this syntax, which is why I named it starting with an A

SYNTAX:
code_language.skript:
(set|format) shop slot %number% of %player% (with|to) [%integer% of] %itemtype% [with gui name %-string%] [[and ]with gui lore %-strings%] [[and ]with sell price %-integer%] [[and ]with buy price %-integer%]:
Let me break this down for you to make this easier to understand
code_language.skript:
(set|format) shop slot %number% of %player%
Setting the slot number of the shop in the gui for the player

code_language.skript:
(with|to) [%integer% of] %itemtype%
This is the amount and item you want in your shop. (Defaults to 1 if left out)
The amount won't show up in the gui as that many items, but rather in the lore for sell/buy amount.

code_language.skript:
[with gui name %-string%] [[and ]with gui lore %-strings%]
You can set the name and lore separately from the actual name and lore of the item. For instance, lets say you put a diamond sword named "SHARPIE" in as your item, well you can give it a different name to show up in your GUI, same goes for the lore.

code_language.skript:
[[and ]with sell price %-integer%] [[and ]with buy price %-integer%]
Here is where you set the buy and sell price for said item, per item. The API will take care of the rest. If you are selling 10 items for 10 each, you API will automatically calculate for you, resulting in $100

PICTURES:
Heres some little pics to show the GUI in action
ZldbNxX.png
j28cOk2.png
fY4KJF7.png

EXAMPLES:
These examples are also included in the script itself, and can be removed. They are just there for reference.
code_language.skript:
command /guitest:
    permission: gui.api.test
    trigger:
        open virtual chest inventory with size 3 named "&3GUI" for player

        #! Boring old cobble stone

        set shop slot 1 of player to cobblestone with gui name "&aCOBBLE" with gui lore "&cFancy Cobble" with sell price 10 and with buy price 20
        set shop slot 2 of player to 10 of cobblestone with gui name "&aCOBBLE" with gui lore "&cFancy Cobble" with sell price 10 and with buy price 20

        #! Custom items

        set {_sword} to diamond sword of sharpness 10
        set name of {_sword} to "&3Super Sharp Sword"
        set lore of {_sword} to "&aVery sharp" and "&abe careful"
        set shop slot 3 of player with {_sword} with gui name "&aMystery Sword" with gui lore "&5Never know what you're going to get" with buy price 500

        set shop slot 4 of player with diamond pickaxe of efficiency 10 with gui name "&aSuper Fast Pick" with gui lore "&dThis pick will break crap quickly" with buy price 1000
        set shop slot 5 of player with diamond pickaxe of fortune 10 with gui name "&aSuper Lucky Pick" with gui lore "&dThis pick will give you so much stuff" with buy price 700

        #! Essential stuff but making it loop to save time writing it all out

        set {_basics::*} to stone, dirt, cobblestone, oak log, white wool and sand
        set {_slot} to 6
        loop {_basics::*}:
            set {_item} to capitalized "%loop-value%"
            set shop slot {_slot} of player with loop-value with gui name "&a%{_item}%" with sell price 1 and with buy price 2
            add 1 to {_slot}
Author
ShaneBee
Downloads
1,420
Views
1,420
First release
Last update
Rating
5.00 star(s) 4 ratings

More resources from ShaneBee

Latest reviews

Using a tiny bit of tweaking, to remove the TuSKe code, it works on 1.20.1, still an amazing resource to this day shane!
Amazing, really useful for people who don't wanna spend a bunch of time banging their head against a wall with making massive TuSKe GUI's for shops. One of the best API's for in game shops I've ever seen.
I like this, Good Resource bro.
.........................
ShaneBee
ShaneBee
Thank you very much!
Im glad to hear you are enjoying it!
Honesty, this is great. I'm making an entire prison server with skript only so this helps me out a lot. Thanks!
ShaneBee
ShaneBee
Thanks for the 5 stars. Im glad you are enjoying this.
I just wanted to make something to simply making shops :)