#help rq

1 messages · Page 1 of 1 (latest)

fervent bluff
#

Need some help

#

this is message every time

shut kite
#

send full code

#

!format

dry lavaBOT
# shut kite !format

:technologist: Code Blocks

To make it easier for others to read your code, it is asked that you send it in a code block. On Discord, you can simply send this:

```
Code here
```

shut kite
#

in code blocks ^^

#

this is hard to see and it's missing a part

#

and I think that part is causing the issue

fervent bluff
#

ok will do

#
    trigger:
        if arg-1 is "wheat":
            set {_am} to amount of wheat in player's inventory
            set {_sl} to arg-3
            if {_sl} <= 0:
                send "&cYou can't sell 0 wheat!!!"
            else:
                if {_sl} > {_am}:
                    send "&cYou can't sell more than you have!!!"
                else:
                    remove 1 wheat from player
                    add {_sl} to {balance::%player's uuid%}
                    send "&2You've sold %{_sl}% Wheat for %{_sl}%$"
        if arg-1 is "all":
            if arg-2 is "wheat":
                set {_} to amount of wheat in player's inventory
                add {_} to {balance::%player's uuid%}
                remove {_} of wheat from player
                send "&2You've sold %{_}% Wheat for %{_}%$"
            else:
                if arg-2 is "carrot":
                    set {_1} to amount of carrot in player' inventory
                    add {_1} to {balance::%player's uuid%}
                    add {_1} to {balance::%player's uuid%}
                    remove {_1} of carrot from player
                    send "&2You've sold %{_1}% carrot for %{_1}*2%$"```
#

sent

shut kite
#

what command did you run to get the nones?

fervent bluff
#

./sell wheat (number)

#

with any number even 0 even if 0 is def

shut kite
#

wdym def

#

0 isn't default

#

if you leave the value empty, it's gonna be null, or as it shows, <none>

#

oh I see

#

you need to debug to see what exactly is going on with the ifs

#

put some send messages to check where the code goes
example: send "debuginfo: all-wheat" after the arg-1 "all" and arg-2 "wheat"

#

I think it goes there for some reason

#

because I'm not sure {_} is really a variable

#

_ is just the temporary tag, your var has no name

fervent bluff
#

will try that

fervent bluff
#

can i get a completed code nothing is really working so sorry

still dust
fervent bluff
#

recently tested it still did not work

still dust
#

So what did u change?

fervent bluff
#

set {_sl} to arg-2

still dust
#

Arg-2 is a text right now

#

Btw why not make it a /sell hand

#

Instead of having to input item type

fervent bluff
#

hmm

#

thats a good idea

#

and way easier

#

ty will do

shut kite
still dust
rustic hill
#

how to make a request for a skript?