I feel really dumb asking this but what exactly is wrong with this line. It says that it can not read the "value" because it's null
if($gameSwitches.value(9) === true){
}
Apparently there can be some problems using the strictly equal operator on boolean values in JavaScript, depending how they are defined. It's not really necessary to say "=== true" anyway. If the switch is on, if($gameSwitches.value(9)){} should be sufficient, and that's what I would opt for.
Other than that, I can't see a problem. I put your snippet into my project without issue. Are you certain you don't have any typos?
i got it to work thanks sorry for the late reply
It is not saying the value is null. It is saying $gameSwitches is null. The full error message (which you should have quoted exactly) was probably more something like "cannot read property value of null".
It means you were running the command before $gameSwitches had been created - need to move it into a function that runs after a new game is started or a saved game is loaded.