Help with this script

Hello, I need your help, I am creating a HUD, but there is a script that is to calculate the HP / MHP but what does not work, I will leave the page so they can review the script.

I have the Plugin SRD_HudMaker, but it does not give me the personalization for each character, since when starting the game, the person will select the character that he wants to play, so that does not leave me, instead he leaves me.

thank you very much I hope you understand me, I use google translator, I speak spanish


Code:
$gameParty.members(2).mhp
hp = $gameParty.members(2).hp
calculate = (hp * 100) / mhp
screen.pictures(2).move(0, 10, 10, calculate, 100, 255, 0, 60)


https://www.rpgmakercentral.com/blo...ud-beginner-intermediate-using-common-events/
Code:
$gameParty.members(2).mhp

Code:
mhp = $gameParty.members(2).mhp


Or you could just do this:
Code:
screen.pictures(2).move(0, 10, 10, 100 * $gameParty.members(2).hpRate(), 100, 255, 0, 60)

instead of creating variables and calculating it yourself (there is already a function to do the calculation).
It does not work for me, since it generates an error
We can't help with the error if you don't tell us what it says. If you ever need help with something that's not working, tell us what you expect it to do and what it IS doing instead. If it's giving you an error, then tell us what the error says. Otherwise we're just going to have to ask you what it says, which means it takes longer to solve.

Actually, $gameParty.members() does not take any argument. Try $gameParty.members()[2]

That is, if you want the THIRD party member. If you want the SECOND party member, it will be $gameParty.members()[1] because the leader is always [0].
Ok ty
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/help-with-this-script.102501/