Solved When i loop items, the messages too.

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

couger44

Supporter
Feb 19, 2017
713
31
28
Chile
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_language.skript:
on command "/sell":
    cancel event
    sender is a player
    if "%region at player%" contains "minapvp":
        loop all items in the inventory of player:
            loop-item is diamond:
                set {_diamantes} to item amount of loop-item
                set {_diamantes.dinerototal} to 78 * {booster.%player%} * {_diamantes}
                add {_diamantes.dinerototal} to player's balance
                remove loop-item from player's inventory
                send "&8&m-------------------------"
                send "&7Se te removieron &2&lDiamantes de tu inventario"
                send "&7Se te agregaron &2&l$%{_diamantes.dinerototal}%&7 a tu dinero"
                send " "
                send "&7Multiplicador X%{booster.%player%}%"
                send "&8&m-------------------------"
 
it doesn't work for me, but try use stop in the script
Code:
on command "/sell":
    cancel event
    sender is a player
    if "%region at player%" contains "minapvp":
        loop all items in the inventory of player:
            loop-item is diamond:
                set {_diamantes} to item amount of loop-item
                set {_diamantes.dinerototal} to 78 * {booster.%player%} * {_diamantes}
                add {_diamantes.dinerototal} to player's balance
                remove loop-item from player's inventory
                send "&8&m-------------------------"
                send "&7Se te removieron &2&lDiamantes de tu inventario"
                send "&7Se te agregaron &2&l$%{_diamantes.dinerototal}%&7 a tu dinero"
                send " "
                send "&7Multiplicador X%{booster.%player%}%"
                send "&8&m-------------------------"
                stop
 
There you are.
Code:
on command "/sell":
    cancel event
    sender is a player
    if "%region at player%" contains "minapvp":
        set {_diamondsinplayerinventory} to amount of diamonds in player's inventory
        wait a tick
        set {_diamondsinplayerinventory} to {_diamondsinplayerinventory} * {booster.%player%} * 78
        wait a tick
        add {_diamondsinplayerinventory} to player's balance
        remove all diamonds from player's inventory
        send "&8&m-------------------------"
        send "&7Se te removieron &2&lDiamantes de tu inventario"
        send "&7Se te agregaron &2&l$%{_diamondsinplayerinventory}%&7 a tu dinero"
        send " "
        send "&7Multiplicador X%{booster.%player%}%"
        send "&8&m-------------------------"
 
There you are.
Code:
on command "/sell":
    cancel event
    sender is a player
    if "%region at player%" contains "minapvp":
        set {_diamondsinplayerinventory} to amount of diamonds in player's inventory
        wait a tick
        set {_diamondsinplayerinventory} to {_diamondsinplayerinventory} * {booster.%player%} * 78
        wait a tick
        add {_diamondsinplayerinventory} to player's balance
        remove all diamonds from player's inventory
        send "&8&m-------------------------"
        send "&7Se te removieron &2&lDiamantes de tu inventario"
        send "&7Se te agregaron &2&l$%{_diamondsinplayerinventory}%&7 a tu dinero"
        send " "
        send "&7Multiplicador X%{booster.%player%}%"
        send "&8&m-------------------------"
You are a beast, really thanks.
Now works perfect:
upload_2019-3-31_22-31-4.png
 
Last edited:
Status
Not open for further replies.