#It only take 98, Im trying to get it to take a certain amount of 100 bills
1 messages · Page 1 of 1 (latest)
I tried that but nothing removes from the player's balence
also are you aware that {withdraw100_} is not a local variable
try broadcasting it ig, or re-parsing it as an integer
how
how what
why does it say -98 when I type /withdraw100bill 2
still -98
did that, seems as if the variable is -98
^ if you are going to use a varaible here it should be local
but
variables are used to store information so that
- it can be used elsewhere
- it can be saved and used later
this does neither, you have a perfectly good expression to use
So what do I do?
well,
the variable is the exact same as arg-1 * 100, you can just plug that in
Outcome is still -98
it should be 200 since I typed 2
debug
broadcast the arg
also, the paper you give them is always named $100, and will not change if they increase/decrease the arg
I want you to be able to say how many 100 bills you want to withdraw
so if 2 then 200
😅 i didnt see you were giving arg-1 of, whoops
although in that case as you cannot have fractional bills, i would use an integer instead of number
also add a check to make sure its > 0
so -100 + 2 would be -98
maybe arg-1 is thinking argument minus one, and then times 100.
either use parenthesis, or just arg
but what version of skript are you using? ive hyphenated args when i only had one and have never had this issue
try (arg-1) * 100
1.20.4
it works now, thanks