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.

Players balance is more than 0

Discussion in 'Skript' started by KorixCZ, Jul 6, 2021.

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

    KorixCZ New Member

    Joined:
    Jun 29, 2021
    Messages:
    5
    Likes Received:
    0
    Hello, I need advice. I'm trying to make a player whose economy I have defined. However, there is a smaller catch and the fact that I want to ensure that my custom economy can not add balance to the minus. So I want to find out if the player who uses the order has more than 0 on the account. I use vault + essentials as an economy. But with this code that I have, it shows me an internal error error .. The script itself reloads it for me without a problem. Thanks for the help

    CODE -


    command /faction [<offlineplayer>] [<int>]:
    trigger:
    if arg 1 is "Farmas":
    if arg 2 > 0:
    loop all players:
    if player's balance is more than 0:
    add arg 2 to {balfarmaa.%arg 1%}
    send "set %arg 2% to %arg 1%, Balance - %{balfarmaa.%arg 1%}%"
    make console execute command "eco take %player% %arg-2%"

    OR pastebin -
    https://pastebin.com/q1vcJcAu

    Thanks for help me <3.
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    So you want to take money from the player(arg-1) and it should not go into negative, or I'm not sure, sorry?
    Btw. you can replace the "eco take" thing with "remove xx from player's balance"
     
  3. KorixCZ

    KorixCZ New Member

    Joined:
    Jun 29, 2021
    Messages:
    5
    Likes Received:
    0
    Yes. You´re right.
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    39
    then you have to change
    Code (Text):
    1. if player's balance is more than 0:
    to
    Code (Text):
    1. if arg-1's balance is more than 0:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...