Wait Script with Variable in Move Route Error

I am trying to build an event with a short animation via "custom move route" that plays and than waits for a time which comes from a variable, so other events play the same animation with the same waiting time (the variable changes over time obviously).

This is the script I used in the move route:

wait($game_variables[70]) event.png

The Error is:

Script 'Game_Character' line 180: NoMethodError occured. undefined method 'wait' for #<Game_Event: 0xb5cc5a0>

errorMsg.png

I tried this also in a fresh and empty project and I get the same error.

The same Scriptline works in a plain Event perfectly fine, but not in a custom move route. Any Idea?
Because the Script event command gets executed inside the Game_Interpreter context, which has a wait() method. The move route gets executed inside the Game_Character context, which doesn't have a wait() method.


This is line 150 of the Game_Character script:

when ROUTE_WAIT; @wait_count = params[0] - 1So in your Move Route > Script call, simply do @wait_count = $game_variables[70] - 1
The variable needs to refer to number of frames, not seconds. So if it's seconds, do $game_variables[70] * 60 - 1
Works like a charme... Thanks a lot for the quick response!

Original thread: https://forums.rpgmakerweb.com/threads/wait-script-with-variable-in-move-route-error.54641/