Script to pause/resume timer on RMXP

Hello, everyone.

I have a simple code. When i'm on a battle and the timer reaches 0:00, I'm kicked out of the battle.

So, I have a script that pause and resumes the timer. It works on RMVX Ace, but on RMXP this message appears:

" undefined method `update' for class `Game_Timer' "

What can be done?

Code:
class Game_Timer  alias timer_plus_update update  def update    if !@pause      timer_plus_update    end  end  def pause    @pause = true  end  def resume    @pause = false  endend
You will not be able to use XP, VX or VX Ace scripts on RMs other than the ones they were made for.

Conversions or rewrites of the scripts have to made before the scripts can be used in a different engine that what they were initially written.

Try searching this site to see if they have a script you can use :

http://www.gdunlimited.net/forums/forum/14-rpg-maker-xp-scripts-rgss1/?prune_day=100&sort_by=Z-A&sort_key=last_post&topicfilter=all
Thanks for the help. I actually don't understand much about RGSS, I modify some scripts just by logic cause I know some programming languages.

I found a topic on the link that made me realize that there's not "game_timer" on RMXP. The timer is on "game_system". So I just had to change the class and variable and done! Working as it should.

Code:
class Game_System  #--------------------------------------------------------------------------  # * Pause  #--------------------------------------------------------------------------  def pause    @timer_working = false if @timer > 0  end  #--------------------------------------------------------------------------  # * Unpause  #--------------------------------------------------------------------------  def unpause    @timer_working = true if @timer > 0  endend
Glad you managed to solve your problem.

You must have had prior scripting knowledge!

Good luck! ^^
Haha, thanks.

I know that, I just don't have much time to learn now, so I asked for help just today. But in a short future I hope can solve my own problems lol
Don't be afraid to ask for help around here.

Though the community may not be able to answer all your questions or may sometimes tell you to refer elsewhere, such as tutorials, they are generally a helpful bunch.

The fact that you have some programming knowledge will help you in the long run when it comes to scripting.

Again, good luck, and have a great time creating your game! ^^

Original thread: https://forums.rpgmakerweb.com/threads/script-to-pause-resume-timer-on-rmxp.34466/