Shop Help [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.

Breezy

Member
Jul 5, 2019
4
0
0
24
I am currently working on a skript, for a farming server. I have the basics down for this skript, but I can't understand why a part of this skript is not working. (Its like all the other parts) The skript I am trying to work on is a /shop skript. Here is a image of the skript thats not currently working.
388db17d5af0266ed51be1510de17695.png

and here is a image of the skript that DOES work.
ba09aa276051ad6ba52759ed6a96960d.png

I am fairly new to skripting so I'm not 100% sure why its not working. Thanks if anyone helps! (All of these skripts have been tested and yes, all but the one I need help with works)
 
It could be the image, but I think I think that by trying to put ':' at the end of "to run", the script could work
 
I'm able to do /sk reload shop (the name of my file) and whenever I do so, it says that theres a empty configuration section, (line 21) that theres an unexpected entry for 'else'., that it can't understand the condition/effect (line 20) and that '1 sugarcane' can't be added because the former is neither an item type, inventory nor an experience point. (line 22)
 
change syntax:

Code:
command /Shop:
  trigger:
    wait 1 tick
    open chest with 3 rows named "FIRST GUI NAME" to player
    set slot 10 of player's current inventory to wheat named "FIRST ITEM NAME"

on inventory click:
  if inventory name of player's current inventory is "FIRST GUI NAME":
    cancel event
    if clicked item is wheat named "FIRST ITEM NAME":
      open chest with 3 rows named "SECOND GUI NAME" to player
      wait 1 tick
      set slot 10 of player's current inventory to potato named "SECOND ITEM NAME"
      set slot 11 of player's current inventory to carrot named "THIRD ITEM NAME"
      set slot 12 of player's current inventory to sugar cane named "FOURTH ITEM NAME"
  if inventory name of player's current inventory is "SECOND GUI NAME":
    cancel event
    if clicked item is potato named "SECOND ITEM NAME":
      if player's balance >= 30:
        give potato to player
        subtract 30 from player's balance
        message "&7Successfully bought one potato"
      else:
        message "&7You do not have enought money"
    if clicked item is carrot named "THIRD ITEM NAME":
      if player's balance >= 40:
        give carrot to player
        subtract 40 from player's balance
        message "&7Successfully bought one carrot"
      else:
        message "&7You do not have enought money"
    #REPEAT FOR ANY ITEM
 
change syntax:

Code:
command /Shop:
  trigger:
    wait 1 tick
    open chest with 3 rows named "FIRST GUI NAME" to player
    set slot 10 of player's current inventory to wheat named "FIRST ITEM NAME"

on inventory click:
  if inventory name of player's current inventory is "FIRST GUI NAME":
    cancel event
    if clicked item is wheat named "FIRST ITEM NAME":
      open chest with 3 rows named "SECOND GUI NAME" to player
      wait 1 tick
      set slot 10 of player's current inventory to potato named "SECOND ITEM NAME"
      set slot 11 of player's current inventory to carrot named "THIRD ITEM NAME"
      set slot 12 of player's current inventory to sugar cane named "FOURTH ITEM NAME"
  if inventory name of player's current inventory is "SECOND GUI NAME":
    cancel event
    if clicked item is potato named "SECOND ITEM NAME":
      if player's balance >= 30:
        give potato to player
        subtract 30 from player's balance
        message "&7Successfully bought one potato"
      else:
        message "&7You do not have enought money"
    if clicked item is carrot named "THIRD ITEM NAME":
      if player's balance >= 40:
        give carrot to player
        subtract 40 from player's balance
        message "&7Successfully bought one carrot"
      else:
        message "&7You do not have enought money"
    #REPEAT FOR ANY ITEM
Doesn't seem to work...
 
I am currently working on a skript, for a farming server. I have the basics down for this skript, but I can't understand why a part of this skript is not working. (Its like all the other parts) The skript I am trying to work on is a /shop skript. Here is a image of the skript thats not currently working.
388db17d5af0266ed51be1510de17695.png

and here is a image of the skript that DOES work.
ba09aa276051ad6ba52759ed6a96960d.png

I am fairly new to skripting so I'm not 100% sure why its not working. Thanks if anyone helps! (All of these skripts have been tested and yes, all but the one I need help with works)
Im not sure which Skript version you are using, since you didn't state it, but if you are using 2.3+ its "sugar cane" not "sugarcane"
 
Im not sure which Skript version you are using, since you didn't state it, but if you are using 2.3+ its "sugar cane" not "sugarcane"
Oh, alright. Thanks for the help everyone!... Sorry that I had forgotten to put what skript version I was using but yes, it was 2.3+
 
Status
Not open for further replies.