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 out 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.

Need help with basic buying system

Discussion in 'Skript' started by JadeInnit1, Oct 10, 2022.

Thread Status:
Not open for further replies.
  1. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Hello everyone again! This is a bit of an odd situation again but I'll give you a rundown. I am trying to make a skript where if you click on a sign it will check how much money you have and if you have more than the specified money it will allow you to click the block underneath it which in turn gives you more money.

    I have some idea of how to pull this off, my best guess would be to use the sk-perm and a if statement but other than that I am beyond confused.

    Code at the moment is looking like this
    Code (Text):
    1. options:
    2.    
    3.     balance: 0
    4.     starting_money: 0
    5.     minium_money: 0
    6.     maxium_money:1000000000000
    7.    
    8. on rightclick on dirt:
    9.    message "&A+1$"
    10.    add 1 to player's balance
    11.  
    12. command /balance:
    13.     trigger:
    14.         send "&ABalance: &C%player's balance%"
    15.  
    16. on left click on spruce sign:
    17.     message "You are about to buy this, left click again to buy"
    18.    
    19. if %player's balance% is less than 500
    20.     "You don't have enough money! Do /bal to see how much money you have"
    21. else
    22. message "You've brought it!"
    23.        
    There are 4 errors which I don't know how to fix and they are all the same "all code has to be put into trigger" these errors are in line 19, 20, 21 and 22

    Like always any and all help is appreciated!
     
  2. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    Code (Text):
    1. on left click on spruce sign: #<- this is trigger, a.k.a event section
    2.     message "You are about to buy this, left click again to buy"
    3.  
    4.     if %player's balance% is less than 500: # <- this is condition section, we put this inside event sections with 'tab' or 'space' symbols
    5.         "You don't have enough money! Do /bal to see how much money you have"
    6.     else:
    7.         message "You've brought it!"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...