Conditional Branch Script Call

Hello,

Trying to script call a conditional branch, where the if statement is a switch status.It should check if Switch 1 is true and return either true or false text depending. But I must be doing something wrong because it always returns false (the latter option), whether or not the switch is on or off, and whether or not the condition is checking for true or false. Can anyone see a mistake?

if ($gameSwitches.setValue(1, true)){$gameMessage.add("True")} else {$gameMessage.add("False")}Thank You.
I see the problem, but I haven't studied the code enough to know the solution for sure yet.

$gameSwitches.setValue(1, true)

That sets the switch. It doesn't return the value of the switch. I would try this:

if ($gameSwitches.value(1)) {$gameMessage.add("True")} else {$gameMessage.add("False")}
Ah, I see. Thank you, Chalkdust.
I'm trying work with conditions in RPG Maker MV, but they always still false, when i have all the requisistes to let happen.

I know how do this, but the software dont let me do.

Maybe a bug?
Please start your own thread, rather than adding your question to someone else's related thread. Thank you.


Provide more details - screenshots of the events you are trying to get working (in your own thread)

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-script-call.47044/