From item check to state check

Hello everybody! My knowledge of RGSS3 and Ruby is pretty much 0. Maybe 0.01. Anyway, I have a request, if you would be so kind to help me.

I need to modify a script to force it to check if the actor of the party (the game has only one actor in the party, by the way) has a certain state (id 31) on or not, instead of checking if he has an item or not.

Scripting-wise, I need this to be changed into checking for state id 31:

"$game_party.has_item?($data_items[1]) ? 4 : 8"Thanks a lot to anybody who would spend some of his time to help me with this.

Cheers!
Do you NEED to do this via script? If you just want to check in an event, the Conditional Branch has a tab where you can see if Actor 1 has a specific state inflicted.


If you absolutely MUST do it via script, it would be like this:

Code:
$game_party.leader.state?(31)
Yessss!!! Amazing!!! That's exactly what I needed! Thank you very much Shaz!

And yes, unfortunately I needed to do it inside a script I didn't make. Thanks again! 😀

Original thread: https://forums.rpgmakerweb.com/threads/from-item-check-to-state-check.37583/