Turn off a script

I basically just have a simple HUD script displaying my HP and I want to turn it off for cut scenes/etc, but the script-writer didn't include a turn off/on.

Just wondering if anyone would know how to disable it and re-enable it.

OR just making it invisible would be fine.

if you're curious it's this one:

Thank you!
Alternately, if someone has a script with a very simple HUD that basically just displays HP as simple text and also has a turn off/on capability (or turn opacity 0/255), let me know.
Look at the update method:

Ruby:
  def update
   super
   refresh if (@actor = $game_party.actors[0] or
               @old_hp = @actor ? @actor.hp : 0 or
               @old_maxhp = @actor ? @actor.maxhp : 0 or
               @old_sp = @actor ? @actor.sp : 0 or
               @old_maxsp = @actor ? @actor.maxsp : 0)
  end

That seems to be the best place to include your button to toggle the window's visibility at will.
What I'd do is to alter it a bit to include this feature.

Ruby:
  def update
    super
    if Input.trigger?(Input::A)
      $game_system.se_play($data_system.decision_se)
      self.visible = !self.visible
    end
    if (@actor = $game_party.actors[0] or
      @old_hp = @actor ? @actor.hp : 0 or
      @old_maxhp = @actor ? @actor.maxhp : 0 or
      @old_sp = @actor ? @actor.sp : 0 or
      @old_maxsp = @actor ? @actor.maxsp : 0)
      refresh
    end
  end

If you don't wanna use the A button for toggling the window's visibility, you can replace it with your favorite at any moment.
Look at the update method:

Ruby:
  def update
   super
   refresh if (@actor = $game_party.actors[0] or
               @old_hp = @actor ? @actor.hp : 0 or
               @old_maxhp = @actor ? @actor.maxhp : 0 or
               @old_sp = @actor ? @actor.sp : 0 or
               @old_maxsp = @actor ? @actor.maxsp : 0)
  end

That seems to be the best place to include your button to toggle the window's visibility at will.
What I'd do is to alter it a bit to include this feature.

Ruby:
  def update
    super
    if Input.trigger?(Input::A)
      $game_system.se_play($data_system.decision_se)
      self.visible = !self.visible
    end
    if (@actor = $game_party.actors[0] or
      @old_hp = @actor ? @actor.hp : 0 or
      @old_maxhp = @actor ? @actor.maxhp : 0 or
      @old_sp = @actor ? @actor.sp : 0 or
      @old_maxsp = @actor ? @actor.maxsp : 0)
      refresh
    end
  end

If you don't wanna use the A button for toggling the window's visibility, you can replace it with your favorite at any moment.
thanks for the reply but would it be possible to also turn visibility off/on with a script call?

Original thread: https://forums.rpgmakerweb.com/threads/turn-off-a-script.174947/