Item effect based on user

I want to create an item that has different effects depending on who uses it.


Example: I want the characters to be able to buy beer at a pub. There are two characters, Tim and Eric. Tim is 23 and Eric is 12. I wanna make it so the characters that are over 21 (like Tim), heal from drinking it while characters under 21 (like Eric) receive a negative effect. How could I make that happen?
You'll want to use this formula for the item: if b.id==1;300;elseif b.id==2;-300;0;else;100;end;


If actor 1 uses the item then they will gain 300 HP. If actor 2 uses it they will lose 300 HP.
Do I enter that in the formula bar exactly?
You'll want to use this formula for the item: if b.id==1;300;elseif b.id==2;-300;0;else;100;end;


If actor 1 uses the item then they will gain 300 HP. If actor 2 uses it they will lose 300 HP.

Sorry. Relatively new to RPG Maker. Where would I put that forumla and would I enter it exactly like that?
@metalmario991 In the top right corner of the item tab is a box labeled Formula. Just copy that and change the numbers to what you need and you'll be fine.

Original thread: https://forums.rpgmakerweb.com/threads/item-effect-based-on-user.64973/