IF Help

Currently I have something like

float PourcentPricee = PourcentPrice * 0.5f;
IF STRINGKEY @Price1 LessThanOrEqualTo @PourcentPricee

How would I make it so IF STRINGKEY @Price1 GreaterThan @PourcentPricee ButLessThan PourcentPrice * 0.2f;
(the problem is the But part)
So I want things that are Greater than 50% off but less than 20% off to get added to a different constant list ( I have multiple constant lists depending on price and such)

The problem is that you’re using a STRINGKEY while you should be using a FLOATKEY.
Also why is there a keychain there? IF statements don’t need to live inside a keycheck block, remove the keycheck entirely or it’s not going to work.

Well I didn’t directly copy it from the code I was just quickly typing it to show a example. The code works as expected I just need the greater than 50% and less than 20% part


I did it now I have this

IF FLOATKEY @Price GreaterThan @PourcentPricee ButLessThan @NormalPrice * 0.2f;

It doesn’t return any error but it won’t register the ButLessThan @NormalPrice * 0.2f;
part because ButLessThan is not even real code so it will add it to list every time

That won’t work :slight_smile:

float max = NormalPrice * 0.2f;
IF FLOATKEY @Price GreaterThan @PourcentPricee
IF FLOATKEY @Price LessThan @max 

Sorry for taking so long but it didn’t work and there was no error if needed I can message/email you the config. Also since I realized I could put my config in a loop instead of having 130k lines of lolicode I have

for (int i = 0; i < Stores.Count; i++){

and I have it so if it does match and adds to list it jumps to before the other }


but it returns [IDLE] CompilationErrorException: (304,11): error CS1525: Invalid expression term ‘}’

END gets translated to this } it’s just syntax sugar, so don’t use both and count the number of brackets you opened which should match the number of times you closed it.

I tried that and it still gives the same error if I take away the } it gives the error ‘}’ expected and if I put it says Invalid expressions ‘}’ and if I take one of the END away it gives that same error and there are no extra }.

Take away everything and just write

for (int i = 0; i < Stores.Count; i++) {
// your code here