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 When i loop items, the messages too.

Discussion in 'Skript' started by couger44, Mar 31, 2019.

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

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    I'm creating a skript for a /sell, and i do it, the thing is that when I try the script, when I have more than 64 blocks of the item that I'm going to sell, the message appears again, how can I solve that?

    When i have 64 diamonds:
    upload_2019-3-31_3-57-0.png
    When i have 65 diamonds:
    upload_2019-3-31_3-57-38.png
    Part of code is this:
    Code (Skript):
    1.  
    2. on command "/sell":
    3.     cancel event
    4.     sender is a player
    5.     if "%region at player%" contains "minapvp":
    6.         loop all items in the inventory of player:
    7.             loop-item is diamond:
    8.                 set {_diamantes} to item amount of loop-item
    9.                 set {_diamantes.dinerototal} to 78 * {booster.%player%} * {_diamantes}
    10.                 add {_diamantes.dinerototal} to player's balance
    11.                 remove loop-item from player's inventory
    12.                 send "&8&m-------------------------"
    13.                 send "&7Se te removieron &2&lDiamantes de tu inventario"
    14.                 send "&7Se te agregaron &2&l$%{_diamantes.dinerototal}%&7 a tu dinero"
    15.                 send " "
    16.                 send "&7Multiplicador X%{booster.%player%}%"
    17.                 send "&8&m-------------------------"
    18.  
    19.  


     
  2. Best Answer:
    Post #3 by Ouma Shu, Mar 31, 2019
  3. Ardno

    Ardno Member

    Joined:
    Mar 11, 2019
    Messages:
    38
    Likes Received:
    0
    it doesn't work for me, but try use stop in the script
    Code (Text):
    1. on command "/sell":
    2.     cancel event
    3.     sender is a player
    4.     if "%region at player%" contains "minapvp":
    5.         loop all items in the inventory of player:
    6.             loop-item is diamond:
    7.                 set {_diamantes} to item amount of loop-item
    8.                 set {_diamantes.dinerototal} to 78 * {booster.%player%} * {_diamantes}
    9.                 add {_diamantes.dinerototal} to player's balance
    10.                 remove loop-item from player's inventory
    11.                 send "&8&m-------------------------"
    12.                 send "&7Se te removieron &2&lDiamantes de tu inventario"
    13.                 send "&7Se te agregaron &2&l$%{_diamantes.dinerototal}%&7 a tu dinero"
    14.                 send " "
    15.                 send "&7Multiplicador X%{booster.%player%}%"
    16.                 send "&8&m-------------------------"
    17.                 stop
     
  4. Ouma Shu

    Ouma Shu Member

    Joined:
    Dec 25, 2017
    Messages:
    45
    Likes Received:
    2
    There you are.
    Code (Text):
    1. on command "/sell":
    2.     cancel event
    3.     sender is a player
    4.     if "%region at player%" contains "minapvp":
    5.         set {_diamondsinplayerinventory} to amount of diamonds in player's inventory
    6.         wait a tick
    7.         set {_diamondsinplayerinventory} to {_diamondsinplayerinventory} * {booster.%player%} * 78
    8.         wait a tick
    9.         add {_diamondsinplayerinventory} to player's balance
    10.         remove all diamonds from player's inventory
    11.         send "&8&m-------------------------"
    12.         send "&7Se te removieron &2&lDiamantes de tu inventario"
    13.         send "&7Se te agregaron &2&l$%{_diamondsinplayerinventory}%&7 a tu dinero"
    14.         send " "
    15.         send "&7Multiplicador X%{booster.%player%}%"
    16.         send "&8&m-------------------------"
     
    • Useful Useful x 1
  5. couger44

    Supporter

    Joined:
    Feb 19, 2017
    Messages:
    714
    Likes Received:
    31
    You are a beast, really thanks.
    Now works perfect:
    upload_2019-3-31_22-31-4.png
     
    #4 couger44, Apr 1, 2019
    Last edited: Apr 1, 2019
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...