Instead of Leaving Rule

I am trying to do a instead of leaving rule but it won’t accept leaving as a action.
Is there another word I should use?

Moving from room to room uses the going action, with the location specified by the word “from”. So if you’re in a room named Apiary, this will do what you want:

Instead of going from the Apiary, say "You cannot leave yet."

Thank You!!