Sell all not working

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

Potato

Active Member
Feb 24, 2020
57
1
0
17
I tried to create a /Sell all skript, and this is what my final result came into. But somehow it can't register if the player has the specific item(s).. there is no error to this "error", but it just doesnt work, though still i have the item, the item i have in my inventory is relored, is that maybe why?


Code:
Options:
    troutPRICE: 10.0
    bfishPRICE: 7.0
    tunaPRICE: 5.0

Command /Sell [<String>]:
    trigger:
        if arg-1 is "All":
            if player has raw_fish with name "&7Trout" or clownfish with name "&7Butterfly Fish" or 349:1 with name "&7Tuna":
                set {_Trout} to number of 349 named "&7Trout" in player's inventory
                set {_Bfish} to number of clownfish named "&7Butterfly Fish" in player's inventory
                set {_Tuna} to number of 349:1 named "&7Tuna" in player's inventory
                loop {_trout} times
                remove 1 raw fish named "&7Trout" from player's inventory
                loop {_Bfish} times
                remove 1 clownfish named "&7Butterfly Fish" from player's inventory
                loop {_Tuna} times
                remove 1 349:1 named "&7Tuna" from player's inventory
                if {_trout} > 0:
                    set {_Trout1} to {_Trout} * {@troutPRICE}
                if {_Bfish} > 0:
                    set {_Bfish1} to {_Bfish} * {@bfishPRICE}
                if {Tuna} > 0:
                    set {_Tuna1} to {_Tuna} * {@tunaPRICE}
                set {_Sum} to {_trout1} + {_Bfish1} + {_Tuna1}
                Add {_Sum} to player's balance
                send "&bYou sold all your fish for a total of &a%{_Sum}%&b!"
                play "BLOCK_NOTE_PLING" to player
            else:
                send "&cYou have nothing to sell.."


Also this error..

upload_2020-4-19_20-59-33.png
 
Status
Not open for further replies.