I want to add the value of a variable to a player's money balance with Essentials and Vault

  • 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 community!

    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.

AustinJason

Member
Apr 10, 2020
4
0
0
My code:

variables:
{income::%player%} = 0

command /gens:
description: Lists generators
permission: list.gens
trigger:
open chest with 1 row named "&cGens" to player
wait 1 tick
format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
wait 1 tick
make the player execute "/pay AustinJason 100"

command /incomeadd <money> <player>:
description: adds income
permission: income.add
trigger:
add arg-1 to {income::%player%}

every second in "world":
add {income::%player%} to balance of all players #<=Here
[doublepost=1586507355,1586507212][/doublepost]There are indentations but they dont show up
[doublepost=1586507431][/doublepost]
My code:

variables:
{income::%player%} = 0

command /gens:
description: Lists generators
permission: list.gens
trigger:
open chest with 1 row named "&cGens" to player
wait 1 tick
format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
wait 1 tick
make the player execute "/pay AustinJason 100"

command /incomeadd <money> <player>:
description: adds income
permission: income.add
trigger:
add arg-1 to {income::%player%}

every second in "world":
add {income::%player%} to balance of all players #<=Here
[doublepost=1586507355,1586507212][/doublepost]There are indentations but they dont show up
There are indentations but they dont show up for some reason
 
cmon add code in codeblocks its hard to see code like that...
[doublepost=1586517287,1586514818][/doublepost]here if u have any questions ask
Code:
variables:
    {income::%player%} = 0

command /gens:
    trigger:
        if player has permission "list.gens":
            open chest with 1 row named "&cGens" to player
            wait 1 tick
            format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
            wait 1 tick
            make the player execute "pay AustinJason 100"
        else:
            send "&cNope"

command /incomeadd <money> <player>:
    trigger:
        if player has permission "income.add":
            add arg-1 to {income::%player%}
        else:
            send "&c Oh hell no"
 
cmon add code in codeblocks its hard to see code like that...
[doublepost=1586517287,1586514818][/doublepost]here if u have any questions ask
Code:
variables:
    {income::%player%} = 0

command /gens:
    trigger:
        if player has permission "list.gens":
            open chest with 1 row named "&cGens" to player
            wait 1 tick
            format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
            wait 1 tick
            make the player execute "pay AustinJason 100"
        else:
            send "&cNope"

command /incomeadd <money> <player>:
    trigger:
        if player has permission "income.add":
            add arg-1 to {income::%player%}
        else:
            send "&c Oh hell no"
About this, my problem is that I cannot add the value of the variable into the player’s balance:
add {income::%player%} to balance of player
[doublepost=1586523005][/doublepost]
cmon add code in codeblocks its hard to see code like that...
[doublepost=1586517287,1586514818][/doublepost]here if u have any questions ask
Code:
variables:
    {income::%player%} = 0

command /gens:
    trigger:
        if player has permission "list.gens":
            open chest with 1 row named "&cGens" to player
            wait 1 tick
            format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
            wait 1 tick
            make the player execute "pay AustinJason 100"
        else:
            send "&cNope"

command /incomeadd <money> <player>:
    trigger:
        if player has permission "income.add":
            add arg-1 to {income::%player%}
        else:
            send "&c Oh hell no"
Also, I am new to this so I don’t know how to use code blocks I’m really dumb XD also, thanks for the code
 
this is how u pose code blocks
and im not best at variables i cant do them "/
 

Attachments

  • Screenshot_1.png
    Screenshot_1.png
    10.3 KB · Views: 265
this is how u pose code blocks
and im not best at variables i cant do them "/
Thank you for the help!
[doublepost=1586567097,1586566916][/doublepost]
Code:
variables:
  {income::%player%} = 0

command /gens:
  description: Lists generators
  permission: list.gens
  trigger:
    open chest with 1 row named "&cGens" to player
    wait 1 tick
    format slot 0 of player with grass named "Grass gen" with lore "+1 income" to close then run "incomeadd 1 to 'player'"
    wait 1 tick
    make the player execute "/pay AustinJason 100"

command /incomeadd <money> <player>:
  description: adds income
  permission: income.add
  trigger:
    add arg-1 to {income::%player%}

every second in "world":
  add {income::%player%} to balance of all players #<=Here
So here is the original code
 
Status
Not open for further replies.