Floor spike trap

I am trying to set up a floor spike trap so that when anything, actor and enemy alike, will get damaged when they step on it. how would I set up it up so that no matter what hits it, it deals damage to only that thing?
It's easy for the actor - you just set it to below player and player touch as the trigger. However, events can't trigger other events, normally.


You would have to set it as a parallel process event and use a Call Script to check if there are any other events (or the player) at the same coordinates. $game_map.events_xy will give you an array containing all events at those coordinates (which would include the spike trap event itself). You would then have to look at each of those and determine if it's an "enemy" event, and if it is, deal damage. HOW you deal damage will have to be sorted out, since events don't actually HAVE HP - they're characters, not battlers. And you'd also have to stop it dealing repeated damage on every frame, since it would take quite a lot of frames for the event to go over it.

Original thread: https://forums.rpgmakerweb.com/threads/floor-spike-trap.18040/