Shop Skript

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

Status
Not open for further replies.

Vane

Member
May 27, 2019
11
0
1
I need a shop skript, im on 1.14.2
Does anyone want to give me the functions of it.
Also when removing the players money just make it eco take and when giving a player a item /give (essentials)

I would appreciate any help
 
code_language.skript:
effect set shop slot %integer% of %player% to %item% with [buy price %-number%] [and] [sell price %-number%] [allowing shift [shopping] %-boolean%]:
    trigger:
        set {_item} to expr-3
        set line 5 of lore of {_item} to "&7Buyprice: &6%expr-4 ? ""-""%"
        set line 6 of lore of {_item} to "&7Sellprice: &6%expr-5 ? ""-""%"
        set line 7 of lore of {_item} to "&7Stackbuying: &6%expr-6 ? false%"
        set slot expr-1 of expr-2' current inventory to {_item}
       
       
command shop:
    trigger:
        set {_var} to 1
        open chest inventory with 4 rows named "shop" to player
        set shop slot {_var} of player to emerald named "lol" with buy price 4 and sell price 3.4 allowing shift shopping true
       
       
on inventory click:
    event-inventory != player' inventory
    event-slot != air
    set {_buy::*} to split line 5 of lore of event-slot at " "
    set {_sell::*} to split line 6 of lore of event-slot at " "
    set {_shift::*} to split line 7 of lore of event-slot at " "
    {_buy::*} is set
    cancel event
    event-click type = left mouse button:
        {_buy::*} does not contain "-":
            {coins::%player%} >= uncoloured {_buy::2} parsed as number
            set {_item} to event-slot
            delete {_item}' lore
            give 1 of {_item} to player
            remove uncoloured {_buy::2} parsed as number from {coins::%player%}
    else if event-click type = right mouse button:
        {_sell::*} does not contain "-":
            player has 1 of event-slot
            remove 1 of event-slot from player
            add uncoloured {_sell::2} parsed as number to {coins::%player%}
    else if event-click type = left mouse button with shift:
        {_shift::*} contains "true"
        {_buy::*} does not contain "-":
            {coins::%player%} >= uncoloured {_buy::2} parsed as number*64
            set {_item} to event-slot
            delete {_item}' lore
            give 64 of {_item} to player
            remove uncoloured {_buy::2} parsed as number*64 from {coins::%player%}
    else if event-click type = right mouse button with shift:
        {_shift::*} contains "true"
        {_sell::*} does not contain "-":
            player has 64 of event-slot
            remove 64 of event-slot from player
            add uncoloured {_sell::2} parsed as number*64 to {coins::%player%}
 
Status
Not open for further replies.