Setting a variable to an event

Hey guys I'm trying to do a steal event with yanflys button common events. I have two variables one for players luck and one for npcs luck that I'm trying to steal from. My problem is I'm not sure how to set the luck of individual npcs without talking to them since its binded on a different key as a common event. So is there a way to set individual events a variable so it will just check that? I'm not sure if this makes any sense at all but thanks in advance lol
How do you have the steal event set up?
25iw4ts.png

heres the event it works if something stationary I can put a switch for able on a tile next to the npc but thats the only way I can get it to work lol
First, your break loop has absolutely no function there because there is no loop in that event code.
Second, please give a screenshot of the complete event - you only posted a screenshot of the contents of the event, so we can only guess at the rest (which is important here)

Third, if your NPCs are events, simply don't use a variable for NPC luck but compare the player luck with a fixed number.

Fourth, and that is why I'm asking for the full event - it would usually be better to use self-switches instead of regular switches for checking if the player stole from that specific NPC, but those depend on wether this is a map event or a common event and if common event how that common event is called.

Original thread: https://forums.rpgmakerweb.com/threads/setting-a-variable-to-an-event.75761/