MV How do I access the enemy's health for SumRndmDde's HUD Maker?

Hello,
very sorry if this is a double post from somebody but I can't for the life of me find anything that helps me.

I'm really new at RM in general, and I stumbled upon this HUD Maker plugin which is HELLA helpful, but I do still struggle to find things to make it work the way I want it to.

I want to show the Enemy's/Troop's health bar on the screen battle, but the only variable I found ($gameTroop.members()[0].hp) gives me an error. I've also scrolled through the RMMV Variable script calls timetable but I couldn't find anything that helps out, or at least that was obvious to the eye.

Any help is highly appreciated. Thank you. :LZSlol:


1727345519309.png
($gameTroop.members()[0].hp) gives me an error.
thats the correct syntax for that, but your screenshot shows you using members()[1].
array indices start at 0, so if youre using [1], youre accessing the second enemy. grabbing the hp of the second enemy will generate an error is there is no second enemy, and there doesnt appear to be one in the cropped image
thats the correct syntax for that, but your screenshot shows you using members()[1].
array indices start at 0, so if youre using [1], youre accessing the second enemy. grabbing the hp of the second enemy will generate an error is there is no second enemy, and there doesnt appear to be one in the cropped image
Oh my god I feel dumb... lmao. I thought I needed to indicate [0] as in enemy/troop ID as a set variable, not starting to end.
Thank you so much for explaining, that was alot easier than I thought and it works perfectly now. Take care !

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-access-the-enemys-health-for-sumrndmddes-hud-maker.172172/