#help rq
1 messages · Page 1 of 1 (latest)
: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
```
in code blocks ^^
this is hard to see and it's missing a part
and I think that part is causing the issue
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
what command did you run to get the nones?
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
will try that
can i get a completed code nothing is really working so sorry
{_sl} is being set to arg-3 instead of arg-2
recently tested it still did not work
So what did u change?
set {_sl} to arg-2
Arg-2 is a text right now
Btw why not make it a /sell hand
Instead of having to input item type
well, it's supposed to be a number and arg-3 is a number
yes but their command /sell wheat x was only using arg-1 & 2
how to make a request for a skript?