Solved Bank interest

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

zuhir__

Member
Feb 16, 2017
14
3
3
22
I want every 1 hour add 0.2% of {bank.%player%} to {bank.%player%} (like interest), i want do this with all variables in {account::*} (online and offline players).
I have this at the moment, and i can't make the "interest" part works, any help? Thanks

Code:
on join:
    if {bank.%player%} is not set:
        set {bank.%player%} to 100
        add {bank.%player%} to {accounts::*}

every 1 hour:
    loop {accounts::*}:
        set {Int} to loop-value
        add loop-value * 0.2 to {Int}
        send "%loop-value%" to all players
        delete {accounts::*}
        add {Int} to {accounts::*}
 
I want every 1 hour add 0.2% of {bank.%player%} to {bank.%player%} (like interest), i want do this with all variables in {account::*} (online and offline players).
I have this at the moment, and i can't make the "interest" part works, any help? Thanks

Code:
on join:
    if {bank.%player%} is not set:
        set {bank.%player%} to 100
        add {bank.%player%} to {accounts::*}

every 1 hour:
    loop {accounts::*}:
        set {Int} to loop-value
        add loop-value * 0.2 to {Int}
        send "%loop-value%" to all players
        delete {accounts::*}
        add {Int} to {accounts::*}


Code:
on join:
    if {bank::%uuid of player%} is not set:
        set {bank::%uuid of player%} to 100
 
every 1 hour:
    loop {bank::*}:
        set {bank::%loop-index%} to loop-value * 0.2
        if loop-index parsed as a offline player is online:
            send "U GOT MONEY" to loop-index parsed as a offline player
 
Code:
on join:
    if {bank::%uuid of player%} is not set:
        set {bank::%uuid of player%} to 100
 
every 1 hour:
    loop {bank::*}:
        set {bank::%loop-index%} to loop-value * 0.2
        if loop-index parsed as a offline player is online:
            send "U GOT MONEY" to loop-index parsed as a offline player
Thanks you a lot!
 
  • Like
Reactions: Lego_freak1999
Status
Not open for further replies.