Can an event check for "the lower variable" among 3+ variables?

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
Im eventing a gambling mini game in wich the player and an event both choose a random 1~20 number and then roll a dice. The one who guessed closest wins. But I'm not sure if I can make this with more than one npc-gambler, because i'd have to make a variable for each one (the number they bet) and then check the closest to the dice roll. Any thoughts?

edit: this is my first post, I realized it's in the wrong section (I think) and I don't know how to move it. Sorry about that
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,710
Reaction score
1,127
First Language
Portuguese - Br
Primarily Uses
RMMZ
You can do this:
let minValue = Math.min($gameVariables.value(ID), $gameVariables.value(ID), $gameVariables.value(ID));
$gameVariables.setValue(ID, minValue)

With this, you can store the minimum value of the variables inside the Math.min function in another variable. So you can check the lower value.
 

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
Sorry, I'm kinda noob and I have literally no idea what this means. Could you explain to me how do I use this? It's a plugin? I've never used one
 

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
89
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
Got it. Thank you very much!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,837
Latest member
Dabi
Top