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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved I need a variable converter with half of the other variable

Discussion in 'Requests' started by Cupex, Mar 22, 2021.

  1. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    34
    Likes Received:
    1
    I wanted to make a Skript, where you can convert for example {points.%player%} to {money.%player%} but not exactly the same amount but half of the variable. So if you have 5000 in {points.%player%} you get 2500 for the {money.%player%} variable
     
  2. Best Answer:
    Post #2 by BaeFell, Mar 22, 2021
  3. BaeFell

    BaeFell I'm Poppy
    Admin

    Joined:
    Nov 27, 2016
    Messages:
    833
    Likes Received:
    226
    It's quite simple. I've rounded it to stop decimals, but you can always just remove "rounded" from the line below.

    Code (Skript):
    1.  
    2. set {money.%player%} to rounded {points.%player%} / 2
    3.  
     
  4. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    34
    Likes Received:
    1
    OMG, Thank you very much, its exactly that what I am looking for.
     
    • Like Like x 1

Share This Page

Loading...