I have 10 properties, and I want the game to check which one is the highest. Any simple way of doing this?
??? Sorry I canāt help you
Get a button(or anything) and get text.
Wire the button to the text (when button pressedārun wire pulse back)
Now make a when receving wire pulse block in the text.
In the block: Set text to:get property:(your property)
Copy the text 9 more times one by one (because then the block will also copy)
Dont forget to change the properties in each text block.
Now wire the button (or whatever you chose) to the other 9 texts with when button pressedārun wire pulse back.
So when you press the button you should see all the numbers (if they are number properties) and see which one is the highest
This should work
Sadly, using the checker with properties doesnāt work, as it is bugged, so you will have to use block code.
Create two properties, highestValue, and highestName. These will store the value of the highest property, and the name of the highest property.
Place a trigger, and go to block code. Write:
if (get_property(highestValue) < get_property(myproperty1):
set_property(highestValue, get_property(highestValue)
set_property(highestName, myproperty1)
This checks if my property is greater than the highest property checked so far. To check all 10 properties, copy paste this code over and over, changing the name of the property you are comparing each time.
If you run out of space in the block code of this trigger, add a broadcast on channel button to the code. Setup another trigger to trigger when receiving on that channel, and then put the rest of the if statements in that trigger.
Sorry for the lack of screenshots, Iām on mobile right now.
Thanks! I was trying to make a voting system for Among Us.
I should probably say- there is a more optimal solution, but itās more complex and involves lists. Do you want it?
Yes.
So, first, read this if you havenāt already:
Then, make sure your voting properties all have a naming scheme like āp1votesā, āp2votesā, āp3votesā etc.
Place a repeater, and wire it to a trigger. Then place a property and name it 'āiā or something like that.
Make the repeater repeat 10 times, and then go to the trigger and enter block code.
Then write the following code:
#store the property name in a varible called name
name = create_text("p1", get_property(i), "votes")
#check if the value of name is greater than the highest votes so far
if (get_property(name) > get_property("highest")):
#if so, update the highestName and highestValue properties.
set_property("highestName", name)
set_property("highestValue", get_property(name))
#increase i to check the next property
set_property("i", get_property("i")+1)
#A check to reset the "i" property when all properties have been checked.
if (get_property("i") == 10):
set_property("i", 0)
I hope this makes sense lol
you should make a guide!
Iām procrastinating it lol
Iām working on my next big project in gimkit
Whatās it going to be? Just a hint would be fine lol.
Iām also working on a huge rpg project called Farmersā Quest.
i am still working on monopoly, but i did add to my guide today :}
Donāt even know where to start on CCC lol
Farmersā Quest has 72% memory and a merchant system lol.
the terrain
Well, its not gonna be something boring that gimkit intended for people to make in creative
But other than that, i prefer not to give spoilers, since I usually fail to meet my goals and dont want to raise expectations only to drop them.
Thatās okay. I think I want to create a bossfight first to get feels for the boss fight at the end of Farmersā Quest, so I might make a guide on those.
What kind of bossfight? Like a sentry one or with custom attacks?
Both, probably. Iām making a fake one.
so you are just getting comfortable before you make the real thing?