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.

Solved How do I add one to balance when clicking a specific block?

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

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

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Ok so. I am trying to make a little script to increase my balance by one every time I click a specified block here is the code so far!

    Skript version: 2.6.2
    Author: Quiettee (me)

    Code (Text):
    1.  
    2. options:
    3.    
    4.     balance: 0
    5.     starting_money: 0
    6.     minium_money: 0
    7.     maxium_money:1000000000000
    8.    
    9. on rightclick on dirt:
    10.     add 1 to balance
    11.    
    12. command /balance:
    13.     trigger:
    14.         message "test"
    15.        
    The error I am running into is that it's saying "Can't understand this condition or effect: add 1 to balance" That's the only error I am getting right now. So in conclusion I just need to increase a number by 1 every time I right-click dirt.

    All help is appreciated as per usual

     
  2. Best Answer:
    Post #12 by lotzy, Oct 9, 2022
  3. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    Code (Text):
    1. on rightclick on dirt:
    2.   add 1 to player's money
     
    JadeInnit1 likes this.
  4. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Hmmm for me it says the same error.
     
  5. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    are you have vault installed? What economy plugin do you use?
     
  6. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    I don't have vault installed atm. And for the economy plugin, I'm just trying not to "create my own" I'm just trying to get a thing where it's "Click block increase by 1". The closest thing I have to an economy plugin is essentialsX with the /balance and the /sell
     
  7. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    Then you need use something like skript-reflect for get access to essentialsX economy API
     
  8. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Sounds complicated to say the least. But I will start learning about that now. Thanks again!
     
  9. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    Code (Text):
    1. import:
    2.   com.earth2me.essentials.api.Economy
    3.   java.math.BigDecimal
    4. on rightclick on dirt:
    5.   Economy.add(player.getUniqueId(),new BigDecimal(1))
    Maybe like this, need Skript-reflect installed
     
    #8 lotzy, Oct 9, 2022
    Last edited: Oct 9, 2022
  10. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Well.. It said there were no errors but when I right-clicked dirt and checked my /bal after it didn't do anything
     
  11. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    You checked balance with EssentialsX command, yes?
    Check console also, maybe in console exists error during runtime
     
  12. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Ok, I am back with new information. I am absolutely dumbfounded by how this works! So atm the code is

    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.   add 1 to player's balance
    10.  
    11. command /balance:
    12.     trigger:
    13.     send "Your Balance: &a%player's balance%"
    14.  
    15.        
    But it also gives an error, the error in question is "Your Balance: &a%player's balance%" check if it's spelled correctly or remove it" but the skript works with /bal and not /balance. I am so confused because I thought it wouldn't work in the slightest even if there was 1 error but turns out I am wrong
     
  13. lotzy

    lotzy Active Member

    Joined:
    Mar 15, 2022
    Messages:
    139
    Likes Received:
    22
    mmm, add two 'space' symbols on line with 'send "Your Balance: &a%player's balance%"'
     
    JadeInnit1 likes this.
  14. JadeInnit1

    JadeInnit1 Member

    Joined:
    Oct 3, 2022
    Messages:
    14
    Likes Received:
    0
    Ok everything is working now thanks again lotzy
     
Thread Status:
Not open for further replies.

Share This Page

Loading...