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

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

JadeInnit1

Member
Oct 3, 2022
14
0
1
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:
options:
    
    balance: 0
    starting_money: 0
    minium_money: 0
    maxium_money:1000000000000
    
on rightclick on dirt:
    add 1 to balance
    
command /balance:
    trigger:
        message "test"

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
 
are you have vault installed? What economy plugin do you use?

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
 
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
Then you need use something like skript-reflect for get access to essentialsX economy API
 
Code:
import:
  com.earth2me.essentials.api.Economy
  java.math.BigDecimal
on rightclick on dirt:
  Economy.add(player.getUniqueId(),new BigDecimal(1))
Maybe like this, need Skript-reflect installed
 
Last edited:
Code:
import:
  com.earth2me.essentials.api.Economy
on rightclick on dirt:
  Economy.add(player.getUniqueId(),1)
Maybe like this, need Skript-reflect installed

Well.. It said there were no errors but when I right-clicked dirt and checked my /bal after it didn't do anything
 
You checked balance with EssentialsX command, yes?
Check console also, maybe in console exists error during runtime
Ok, I am back with new information. I am absolutely dumbfounded by how this works! So atm the code is

Code:
options:
    
    balance: 0
    starting_money: 0
    minium_money: 0
    maxium_money:1000000000000
    
on rightclick on dirt:
  add 1 to player's balance

command /balance:
    trigger:
    send "Your Balance: &a%player's balance%"

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
 
Ok, I am back with new information. I am absolutely dumbfounded by how this works! So atm the code is

Code:
options:
   
    balance: 0
    starting_money: 0
    minium_money: 0
    maxium_money:1000000000000
   
on rightclick on dirt:
  add 1 to player's balance

command /balance:
    trigger:
    send "Your Balance: &a%player's balance%"

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
mmm, add two 'space' symbols on line with 'send "Your Balance: &a%player's balance%"'
 
  • Like
Reactions: JadeInnit1
Status
Not open for further replies.