Need help with variable [solved]

Hi guys, I try to add "working" mini games for the player to earn monney.
I already made a coffeshop game where customer have a random variable named "Request" between 1-10 (1=tea,2=coffee ect..).
And the player have to make choice like add water or tea bag to increase another variable named "Cook".
A common event is launch everytime the variable is changed to show a picture of the drink.
At the end if the variable "cook" is equal to "request" the player win.
(I even added random text to match the request)
It work great !

Now i want to make a barber game.
So there is 2 variable Customerhair and RequestHair
1-customerhair is set random between 1 and 9
a picture of the customer is shown
2-requesthair is set equal to customerhair

Now i want the requesthair to be set to a lower number than customerhair
and it dosen't work :/

Any idea how to fix that ?
show us a screenshot of your event commands and we can tell you what went wrong.
but there are too many ways to make such a game to help without seeing the code.
Go to Control variables => Script then put in:
JavaScript:
Math.randomInt($gameVariables.value(x));

Where x is the variable number of customerhair.
It will pick a random number from 0 to 1 less than customerhair current value.
1727138277877.png
Go to Control variables => Script then put in:
JavaScript:
Math.randomInt($gameVariables.value(x));

Where x is the variable number of customerhair.
It will pick a random number from 0 to 1 less than customerhair current value.
View attachment 318571
Thanks it work nice !
Now the pictures showing the request is mess up lol
I have set a condition for every pictures like if requesthair is 9 show pictures long at layers 19 ect..
I have no idea where the new problem is so just gonna erase and remake every picture showing from scratch lol
a big thanks for your help guys !

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-variable-solved.172104/