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.

Solved Money Voucher

Discussion in 'Skript' started by Cupex, Jul 31, 2021.

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

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    42
    Likes Received:
    1
    Hello again,
    I know that this is possible but I don't know how exactly it works so, here is what I want to work

    If you have (f.e) 1 gold ingot with name $100, if you rightclick you will get $100 to your account
    BUT if you have 2 ingots named $100, you'll get $200 to your account. So the amount adds to a variable
    So if you have a stack of gold ingots named $100 you'll get 64*$100.
    If you know what I mean. It has something todo with "loop" but I don't know what.
     
  2. Best Answer:
    Post #2 by alexistb2904, Aug 1, 2021
  3. alexistb2904

    alexistb2904 New Member

    Joined:
    Jul 27, 2021
    Messages:
    8
    Likes Received:
    1
    Code (Text):
    1. on rightclick with gold ingot:
    2.     if name of tool of player is "$100":
    3.         remove 1 of tool from tool
    4.         make console execute command "your_command"
    5.         send "You receive $100" to player
    with this script you need to click for each ingot you have to receive your money

    ------------------------------------------

    Code (Text):
    1. on rightclick with gold ingot:
    2.     if name of tool of player is "$100":
    3.         set {_nb} to amount of gold ingot named "$100" in player's inventory
    4.         remove {_nb} of gold ingot named "$100" from player's inventory
    5.         loop {_nb} times:
    6.             make console execute command "message %player% Test"
    7.         send "You receive $%{_nb}%00" to player
    with this one only 1 time
     
    #2 alexistb2904, Aug 1, 2021
    Last edited: Aug 1, 2021
  4. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    42
    Likes Received:
    1
    Thank you for your help, it works exactly as I imagined it would.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...