Pulling the Actors parameter for a conditional branch check doesn't seem to work.

I'm trying to check Actor 1's LUK, and if it equals something, do X, and it doesn't, do Y. It all seems simple enough. I create a conditional branch and put $gameActors.actor(1).param[7] == 2 in the Script box. I put some dialog, and create an Else branch for sake of testing. The Else branch is always ran. I triple-checked and my actor indeed has 2 LUK (parameter 7). I tried also doing $gameActors.actor(1).param[7] < 999 and it also yielded nothing.

What am I doing wrong? It always runs the Else branch, indicating that the code I did above is never a criteria that is met successfully, leading me to believe that the code itself is incorrect.
1) please post a screenshot of the event, there are several things that could have gone wrong and your post does not contain enough information
2) please use control variable to load the value (no need for a script, it is in the game data segment) and a show text to really display the value at that moment - there are several other parts of the engine that can modify the value, just checking the numbers on the editor might be not enough, but the control variable method will always give the number that is correct at the moment it is called

3) added: In case of javascript, a condition is checked with three === instead of two ==
Hi,

params is a method in this case, so you should use round brackets here:
$gameActors.actor(1).param(7) < 999
You could also use luk instead of param(7) unless you plan to change the checked parameter.

If both your actor and parameter are fixed you actually don't need a script for this, as Andar already suggested.
Thanks. This solved the issue for me.

Original thread: https://forums.rpgmakerweb.com/threads/pulling-the-actors-parameter-for-a-conditional-branch-check-doesnt-seem-to-work.77748/