1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Shop Skript

Discussion in 'Skript' started by Vane, Jun 13, 2019.

  1. Vane

    Vane Member

    Joined:
    May 27, 2019
    Messages:
    6
    Likes Received:
    0
    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
     
  2. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    28
    Likes Received:
    0
    How do you want the shop skript to be? Like in signs or what?
     
  3. Runakai1

    Runakai1 Well-Known Member

    Joined:
    Apr 27, 2018
    Messages:
    386
    Likes Received:
    20
    Code (Skript):
    1.  
    2. effect set shop slot %integer% of %player% to %item% with [buy price %-number%] [and] [sell price %-number%] [allowing shift [shopping] %-boolean%]:
    3.     trigger:
    4.         set {_item} to expr-3
    5.         set line 5 of lore of {_item} to "&7Buyprice: &6%expr-4 ? ""-""%"
    6.         set line 6 of lore of {_item} to "&7Sellprice: &6%expr-5 ? ""-""%"
    7.         set line 7 of lore of {_item} to "&7Stackbuying: &6%expr-6 ? false%"
    8.         set slot expr-1 of expr-2' current inventory to {_item}
    9.        
    10.        
    11. command shop:
    12.     trigger:
    13.         set {_var} to 1
    14.         open chest inventory with 4 rows named "shop" to player
    15.         set shop slot {_var} of player to emerald named "lol" with buy price 4 and sell price 3.4 allowing shift shopping true
    16.        
    17.        
    18. on inventory click:
    19.     event-inventory != player' inventory
    20.     event-slot != air
    21.     set {_buy::*} to split line 5 of lore of event-slot at " "
    22.     set {_sell::*} to split line 6 of lore of event-slot at " "
    23.     set {_shift::*} to split line 7 of lore of event-slot at " "
    24.     {_buy::*} is set
    25.     cancel event
    26.     event-click type = left mouse button:
    27.         {_buy::*} does not contain "-":
    28.             {coins::%player%} >= uncoloured {_buy::2} parsed as number
    29.             set {_item} to event-slot
    30.             delete {_item}' lore
    31.             give 1 of {_item} to player
    32.             remove uncoloured {_buy::2} parsed as number from {coins::%player%}
    33.     else if event-click type = right mouse button:
    34.         {_sell::*} does not contain "-":
    35.             player has 1 of event-slot
    36.             remove 1 of event-slot from player
    37.             add uncoloured {_sell::2} parsed as number to {coins::%player%}
    38.     else if event-click type = left mouse button with shift:
    39.         {_shift::*} contains "true"
    40.         {_buy::*} does not contain "-":
    41.             {coins::%player%} >= uncoloured {_buy::2} parsed as number*64
    42.             set {_item} to event-slot
    43.             delete {_item}' lore
    44.             give 64 of {_item} to player
    45.             remove uncoloured {_buy::2} parsed as number*64 from {coins::%player%}
    46.     else if event-click type = right mouse button with shift:
    47.         {_shift::*} contains "true"
    48.         {_sell::*} does not contain "-":
    49.             player has 64 of event-slot
    50.             remove 64 of event-slot from player
    51.             add uncoloured {_sell::2} parsed as number*64 to {coins::%player%}  
    52.            
    53.        
     
  4. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    28
    Likes Received:
    0
    Well, that works.
     
Loading...