Solved Money Voucher

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

Cupex

Member
Feb 16, 2020
43
1
8
26
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.
 
Code:
on rightclick with gold ingot:
    if name of tool of player is "$100":
        remove 1 of tool from tool
        make console execute command "your_command"
        send "You receive $100" to player

with this script you need to click for each ingot you have to receive your money

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

Code:
on rightclick with gold ingot:
    if name of tool of player is "$100":
        set {_nb} to amount of gold ingot named "$100" in player's inventory
        remove {_nb} of gold ingot named "$100" from player's inventory
        loop {_nb} times:
            make console execute command "message %player% Test"
        send "You receive $%{_nb}%00" to player

with this one only 1 time
 
Last edited:
Thank you for your help, it works exactly as I imagined it would.
 
Status
Not open for further replies.