- Joined
- Nov 9, 2013
- Messages
- 50
- Reaction score
- 2
- First Language
- English
- Primarily Uses
Hello, I'm trying to simulate some aspects of a roulette wheel in a gambling game.
I'm using variables and currently have the numbers working.
I'm attempting to use a variable array to easily check if the Number entered is either Red or Black.
Rather than have 36 conditional branches, I was hoping to use a script call in the event.
Something like this:
Variable 38 holds the Number the player entered. Variable 40 simply holds an array of all the Red Numbers.
Variable 41 is a test variable to see if this works.
No matter what Number I enter into variable 38, my 41 variable is always zero.
obj = $gameVariables.value(38)
arr = $gameVariables.setValue(40,[1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35]);
for(var i=0; i<arr.length; i++)
{
if (arr == obj) $gameVariables.setValue(41,1)
}
Any help would be greatly appreciated!
I'm using variables and currently have the numbers working.
I'm attempting to use a variable array to easily check if the Number entered is either Red or Black.
Rather than have 36 conditional branches, I was hoping to use a script call in the event.
Something like this:
Variable 38 holds the Number the player entered. Variable 40 simply holds an array of all the Red Numbers.
Variable 41 is a test variable to see if this works.
No matter what Number I enter into variable 38, my 41 variable is always zero.
obj = $gameVariables.value(38)
arr = $gameVariables.setValue(40,[1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35]);
for(var i=0; i<arr.length; i++)
{
if (arr == obj) $gameVariables.setValue(41,1)
}
Any help would be greatly appreciated!
