How to "reset" buttons and levers when the player moves off of them?

I tried having the event check for the player moving but that didn't work. For example, I want to have a button that raises back up when the player steps off of it as part of a puzzle. This is on my page two:

If: Script: $gameplayer.isMoving()
<code to play sound and animate the button raising back up>
Control Self Switch: A=OFF
:End

But it's not working. So how do I do this?
What is your trigger set to?

$gameplayer is not correct. It's $gamePlayer.

You could also try just drawing around the button using a region tag, and making your page 2 check to see if the player is on that region.
Changing it to gamePlayer fixed it for me. One simple typo! My trigger was parallel while the trigger on page 1 is player touch. Making that change fixed it so if you step onto the trigger it depresses but when you move away it resets. Perfect! Now to set up the next part of the trigger. I really appreciate it!
Cool - I suspected that would do it.

Just report your first post and let the mods know the question has been answered, and they'll close the thread for you (if you have other issues, they'll go into new threads as you've got this bit working now).
Done and thank you!
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/how-to-reset-buttons-and-levers-when-the-player-moves-off-of-them.106667/