Need help with comparing more than two properties

Hi everyone!

During the creation process of my Olympics recreation, I stumbled upon a problem, I don’t know if there is a way to compare 5 different properties to see which one is greatest. Help is much appreciated if anyone knows how to find out which property, out of a certain amount (like 5 in my case) is greatest.

Much Love!

Oh this one is fun.


I guess multiple if statements :
If property 2 > property 1 && property 2 > property 3 && property 2 > property 4 && property 2 > property 5

i guess a lot of copy pasting is needed :)))

Faster method?
Still thinking.

Yeah, I thought about that method, but then realized I just don’t have the time for that much copy pasting.

Oh, I have idea.

Have a trigger with the block code comparing every property to a single property called (increment)
It’s gonna start at one, then the next time the trigger checks, the property increment by 1.
do this untill only one variable remains.

1 Like

Or, subtract one repeatedly untill only one leaves.

I think you can only compare two properties at a time through block code, but I would be pleased to be wrong.

(I mean left by the way sorry)
this method might work no?

ur right.

1 Like

Well I have 5 properties, and I need to find the greatest one to tally up who has the most wins out of the 6 games. Because of this I am inclined to say that this would not work, but I also don’t fully understand what you are saying. What would I subtract from the property?

Take all five properties, and subtract one from all of them.
Do it again, untill only one (which is the greatest) still remains.
Only flaw is if a tie occurs

Okay, but how does the block code know which property remains?

Have another trigger constantly checking if a property is below (or equal to ) 0

A memory-efficient way to compare properties:

Note:
You will need to have your properties linked to counters.

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.