Repeating Player Touch events

Hi all,

I'm wondering if it's possible to have an event on a timed loop, so that if the player steps on it the event repeats every X frames, but when they step away it stops? I'm trying to create a room with lightning striking the floor, so that if you stand on that particular square it does damage every X frames.

Thanks in advance!
Yes. Add a second page that is a parallel process, and conditioned by a self switch.

On the first page (Player Touch), turn on the self switch.

On the second page, do the following:
Code:
Show lightning
Do damage
Wait X Frames
Control Variables (get player's X position)
If (player's X position variable) is not equal to 15
  turn off self switch
End
Control Variables (get player's Y position)
If (player's Y position variable) is not equal to 10
  turn off self switch
End

So the first page will be active until the player steps on it, and then the second page will become active. It will do the lightning and damage, and wait for however many frames you specify. It will then check to see if the player has moved away, and if they have, it will turn off the self switch. If the player hasn't moved away, the whole thing will be repeated. Replace 15 and 10 with the actual X and Y position of your event.
Thanks! I'll definitely try that first thing tomorrow! The problem I've been having with other methods I've tried is that the player can't move while the event is checking for their location? I have no idea why, but I'll see if this solves it

Original thread: https://forums.rpgmakerweb.com/threads/repeating-player-touch-events.134250/