Multiplier Skript Help

  • 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 community!

    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.

SnaderMC

Member
Sep 7, 2019
10
1
0
No errors in the Skript. Why doesn't this work?

Code:
set {money.%player%} to ({multiplier.%player%} * {money.%player%})
 
{money.%player%} has to be greater than 0 to start off, and what does it output?

Heres the skript, only multiplier don't work, the rest works as it should.
Code:
command /sell [<text>]:
    trigger:
        if arg-1 is not set:
            send "&a&lSELL &8: &2All Commands."
            send "&a&lSELL &8: &6/sell help &8- &eShow this text!"
            send "&a&lSELL &8: &6/sell all &8- &eWill sell your inventory!"
            send "&a&lSELL &8: &6/sell statics &8- &eShow your sell statics!"
            send "&a&lSELL &8: &6/autosell &8- &eSell whenever you have full inventory!"
        if arg-1 is "all":
            set {money.%player%} to 0
            set {sellblock.%player%} to 0
            add 1 to {usedsell.%player%}
            message "&a&lSELL &8: &eCalculating your items!...."
            wait 8 ticks
            loop 2304 times:
                loop all items in player's inventory:
                    if loop-item is cobblestone:
                        remove 1 cobblestone from player
                        add 1 to {sellblock.%player%}
                        add 1 to {totalsellblock.%player%}
                        add 1 to {money.%player%}
                        add 1 to {totalmoney.%player%}
                    else:
                        if loop-item is coal:
                            remove 1 coal from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 5 to {money.%player%}
                            add 5 to {totalmoney.%player%}
                        else if loop-item is iron ore:
                            remove 1 iron ore from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 15 to {money.%player%}
                            add 15 to {totalmoney.%player%}
                        else if loop-item is iron block:
                            remove 1 iron block from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 135 to {money.%player%}
                            add 135 to {totalmoney.%player%}
                        else if loop-item is gold ore:
                            remove 1 gold ore from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 30 to {money.%player%}
                            add 30 to {totalmoney.%player%}
                        else if loop-item is gold block:
                            remove 1 gold block from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 270 to {money.%player%}
                            add 270 to {totalmoney.%player%}
                        else if loop-item is lapis:
                            remove 1 lapis from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 50 to {money.%player%}
                            add 50 to {totalmoney.%player%}
                        else if loop-item is lapis block:
                            remove 1 lapis block from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 450 to {money.%player%}
                            add 450 to {totalmoney.%player%}
                        else if loop-item is diamond:
                            remove 1 diamond from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 100 to {money.%player%}
                            add 100 to {totalmoney.%player%}
                        else if loop-item is diamond block:
                            remove 1 diamond block from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 900 to {money.%player%}
                            add 900 to {totalmoney.%player%}
                        else if loop-item is emerald:
                            remove 1 emerald from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 250 to {money.%player%}
                            add 250 to {totalmoney.%player%}
                        else if loop-item is emerald block:
                            remove 1 emerald block from player
                            add 1 to {sellblock.%player%}
                            add 1 to {totalsellblock.%player%}
                            add 2250 to {money.%player%}
                            add 2250 to {totalmoney.%player%}
            set {money.%player%} to ({money.%player%} * {multiplier.%player%})
            message "&a&lSELL &8: &eYou sold &6%{sellblock.%player%}% blocks &efor &6%{money.%player%}%$&e!"
            message "&a&lMULTIPLIER &8: &eYour multiplier is &6%{multiplier.%player%}%x&e!"
            add {money.%player%} to player's balance
        else if arg-1 is "help":
            send "&a&lSELL &8: &2All Commands."
            send "&a&lSELL &8: &6/sell help &8- &eShow this text!"
            send "&a&lSELL &8: &6/sell all &8- &eWill sell your inventory!"
            send "&a&lSELL &8: &6/sell statics &8- &eShow your sell statics!"
            send "&a&lSELL &8: &6/autosell &8- &eSell whenever you have full inventory!"
        else if arg-1 is "statics":
            send "&a&lSELL &8: &6Total money earned: &e%{totalmoney.%player%}%$"
            send "&a&lSELL &8: &6Total blocks sold: &e%{totalsellblock.%player%}% blocks"
            send "&a&lSELL &8: &6Your multiplier: &e%{multiplier.%player%}%x"
            send "&a&lSELL &8: &6Used command of /sell all: &e%{usedsell.%player%}% times"
 
code_language.skript:
loop 2304 times:
    loop all items in player's inventory:
qzDS.png


There's so many things wrong on that code, anyways what's the value of {money.%player%} and have you tried
code_language.skript:
add  {money.%player%} * {multiplier.%player%} to player's balance
My code works at it should, and simply my question is "how to multiply two variables" :emoji_slight_smile:
 
Oh great, one of those who won't accept criticism :emoji_grinning:

Your code IS wrong.

The answer to your question is simple my man!
code_language.skript:
set {RESULT} to {VAR::1} * {VAR::2}

Off-topic: Let's say 30 players execute the command, imagine iterating 2304 times over ALL ITEMS IN PLAYER'S INVENTORY
Already tried it, didn't work for me.
And I would be glad if you have something I could do better in my skript.
 
I've told you one thing you could do on your Skript, anyways what's your Skript version?
Don't know, but when i try "/sk update check" it says "You're currently running the latest stable version of Skript."
 
Status
Not open for further replies.