Item=Variable

I want to create a common event on parallel process that keeps an item in the player's inventory always equal to a variable.

For example, if I was using Items to represent the player's health I would have a common event on parallel process and the event would be

Item ID 3 (Player's Health)= Variable 3 (which is set up to equal the amount of HP for Actor 1)

I can set Items to increase by a variable, but how do I keep it consistent with the variable? So if the character were to lose 3 health, they would also lose the three items?
I made a small script for you. Grab it here: Pastebin
Script call:
PHP:
set_item_var(item_id,var_id)
Hope it would help you solve your problem.
Thank you! It works. 🙂
Yea, glad to hear that! 👋
( I apologise to the staff, I have accidentally posted this in the wrong tab on my web browser )

Skurge, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Also, don't hijack other people threads. I'm closing this now, as the OP's problem was solved last year.

Original thread: https://forums.rpgmakerweb.com/threads/item-variable.75711/