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.

Sell All command

Discussion in 'Skript' started by robot1007, Feb 17, 2018.

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

    robot1007 Member

    Joined:
    Feb 17, 2018
    Messages:
    1
    Likes Received:
    0
    Ok I've made all of the currency related commands, bal, baltop, pay etc, but I still need a way for players to sell items they get.
    ITEMS VALUES:
    Coal - 1 coin
    Iron Ingot 3 coins
    Lapis lazuli - 6 coins
    Redstone - 10 coins

    Variables:
    {coins::%player's uuid%}

    I've tried a few setups but they all dont work...
    Anyone have any suggestions on how to set up a command that sees if you have any of these items and then turns them into coins?
     
  2. ChisleLP

    ChisleLP Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    789
    Likes Received:
    60
    This is my very old "Prison skript", may this help you contiue.


    Code (Skript):
    1. set {_cobblestone} to number of cobblestone in player's inventory
    2. set {_ironore} to number of iron ore in player's inventory
    3. set {_stone} to number of stone in player's inventory
    4. set {_glowpuder} to number of glowstone dust in player's inventory
    5. set {_glowstone} to number of glowstone in player's inventory
    6. set {_value1} to {@Cobblestone} * {_cobblestone}#!<---
    7. set {_value2} to {@Stone} * {_stone}#!<---
    8. set {_value3} to {@Ironore} * {_ironore}#!<---
    9. set {_value4} to {@GlowstoneDust} * {_glowpuder}#!<---
    10. set {_value5} to {@Glowstone} * {_glowpuder}#!<---
    11. set {_value10} to {_value1} + {_value2} + {_value3} + {_value4}#!<---
    12. remove all glowstone dust, stone, iron ore, glowstone and cobblestone from player's inventory
    13. add {_value10} to {Money::%player%}
     
    • Like Like x 2
Thread Status:
Not open for further replies.

Share This Page

Loading...