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

Death money.

Discussion in 'Skript' started by TheCringleYT, Nov 13, 2019.

  1. TheCringleYT

    TheCringleYT Well-Known Member

    Joined:
    Sep 29, 2019
    Messages:
    54
    Likes Received:
    1
    Hello,

    I wanted to know how to make it so when someone killed someone else it would give them money (random between $1-$20.

    Help appreciated,

    - TheCringleYT
     
  2. AsuDev

    VIP

    Joined:
    Jan 27, 2017
    Messages:
    196
    Likes Received:
    18
    Code (Skript):
    1. on death:
    2.     attacker is a player
    3.     victim is a player
    4.     set {_m} to a random integer between 1 and 20
    5.     if victim's balance is greater than or equal to {_m}:
    6.         remove {_m} from victim's balance
    7.         add {_m} to attacker's balance
    8.     else:
    9.         add victim's balance to attacker's balance
    10.         set victim's balance to 0
    I wasn't sure if it was taking money or not. If it is, then use the above code. If you just want to give the attacker money without taking the victims money, do this:
    Code (Skript):
    1. on death:
    2.     attacker is a player
    3.     victim is a player
    4.     add (random integer between 1 and 20) to attacker's balance
     
  3. TheCringleYT

    TheCringleYT Well-Known Member

    Joined:
    Sep 29, 2019
    Messages:
    54
    Likes Received:
    1
Loading...