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.

offline money

Discussion in 'Skript' started by uhdwo, Jun 4, 2020.

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

    uhdwo Member

    Joined:
    May 18, 2020
    Messages:
    20
    Likes Received:
    0
    hi does anyone know if its possible to get a palyer's balance even if they are offline?
    it works when they are online but not offline.... plz help


    my code:

    command /offlinemoney [<offline player>]:
    permission: money.admin
    trigger:
    if arg-1 is set:
    message "&bPlayer has &c%balance of arg-1% &bmoney"
     
  2. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    This worked perfect to me:
    Code (Skript):
    1. command /bal [<offline player>]:
    2.     trigger:
    3.         if arg 1 is not set:
    4.             send "&bYour balance is &9 %player's balance%"
    5.             stop
    6.         if arg 1 is set:
    7.             if player has permission "money.admin":
    8.                 send "&bThe %arg 1%'s money is&9 %arg 1's balance%"
    9.                 stop
    10.             else:
    11.                 send "&cNo permissions."
    12.                 stop
     
  3. uhdwo

    uhdwo Member

    Joined:
    May 18, 2020
    Messages:
    20
    Likes Received:
    0
    i know, but when the player is offline it gives "<none>"
    what do i do about that plz help
     
  4. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    That itself is not a skript problem. Remember that 'that' offline player must have entered the server and had activity on him balance.
     
  5. uhdwo

    uhdwo Member

    Joined:
    May 18, 2020
    Messages:
    20
    Likes Received:
    0
    i am using vault... isn't there anything i can do plz someone help i really REALLY need this to work plz! <3

    the player has been online and he have money on his balance but when he logout it gives "<none>" plzzzzzzzzzzzz help <3
     
  6. GreenGamer42

    GreenGamer42 Member

    Joined:
    Apr 17, 2020
    Messages:
    3
    Likes Received:
    0
    Try this:


    Code (Text):
    1. command /offlinemoney [<offline player>]:
    2.     permission: money.admin
    3.     trigger:
    4.         if arg-1 is set:
    5.             message "&b%arg-1's balance%"
     
  7. uhdwo

    uhdwo Member

    Joined:
    May 18, 2020
    Messages:
    20
    Likes Received:
    0
    still gives me "<none>" :emoji_frowning:
     
  8. GreenGamer42

    GreenGamer42 Member

    Joined:
    Apr 17, 2020
    Messages:
    3
    Likes Received:
    0
    Hmm, can u try [<offlineplayer>]
     
  9. uhdwo

    uhdwo Member

    Joined:
    May 18, 2020
    Messages:
    20
    Likes Received:
    0
    still "<none>" :emoji_frowning:((
     
  10. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    Can you send a screenshot with '<none>' message? And show the player to whom you wrote in argument.

    EDIT:
    Try with this:
    Code (Skript):
    1. command /bal [<offline player>]:
    2.     trigger:
    3.         arg 1 is set:
    4.             set {_bal} to arg 1's uuid
    5.             set {_arg} to {_bal}'s balance
    6.             send "&aBalance of %arg 1% is:&2 %{_arg}%"
     
  11. zTak

    zTak Active Member

    Joined:
    Mar 3, 2018
    Messages:
    84
    Likes Received:
    6
    just create a variable if the player quits:

    On quit:
    set {money.%player%} to player's balance

    Than /money [<offlineplayer>]:
    trigger:
    send "%{money.%player%}%"
     
  12. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    There you would be showing the balance of the command executor. If you want it with variables, it would be something like this:
    Code (Skript):
    1. on join:
    2.     set {money.%player%} to player's balance
    3.  
    4. command /bal [<offline player>]:
    5.     trigger:
    6.         arg 1 is set:
    7.             send "&a%arg 1%'s balance is:&2 %{money.%arg 1%}%" to sender
    Also, it's not recommended to save player money in a variable. Variable contents will be lost once the server stops.
     
  13. zTak

    zTak Active Member

    Joined:
    Mar 3, 2018
    Messages:
    84
    Likes Received:
    6
Thread Status:
Not open for further replies.

Share This Page

Loading...