Damage Pop-up Script

I'm currently using Damage Pop-up Script by LittleDrago but when I wanted to show a pop-up text above an event it caused an error
bandicam 2024-08-16 18-04-33-446.jpg

Ruby:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#  Damage Pop Up
#  Ver: 1.02
#  Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  Instruction :
#     $scene.damage(event, string, random, color)             # for XP / VX
#     SceneManager.scene.damage(event, string, random, color) # for VXA
#
#     event  = -1: player, 0: self, >1: events
#     string = all kind of string or number
#     random = random position damage (recommended 0-10)
#     color  = [R,G,B,A] or Color.new(R,G,B,A)
#              if Drago Core Engine is used,
#                you can use Color.red, Color.blue, etc
#                (look at Drago Core Engine at Color part) as values
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

module LiTTleDRAgo
 
    DMGFONTNAME   = ["VL Gothic","Calibri","Georgia",Font.default_name] 
    DMGFONTSIZE   = 25       
    DMGBOLDITALIC = [false, false]

end

($imported ||= {})[:drg_damage_pop_up] = 1.02
#==============================================================================
# ** Damage_String
#------------------------------------------------------------------------------
#  This sprite is used to display damage_sprite.
#==============================================================================

class Damage_String < Sprite
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(id = -1, s = "", r = 0, c = Color.new(255,255,255))
    super(nil)
    self.bitmap = Bitmap.new(96,32)
    self.bitmap.font.name   = [LiTTleDRAgo::DMGFONTNAME].flatten
    self.bitmap.font.size   = LiTTleDRAgo::DMGFONTSIZE
    self.bitmap.font.bold   = LiTTleDRAgo::DMGBOLDITALIC[0]
    self.bitmap.font.italic = LiTTleDRAgo::DMGBOLDITALIC[1]
    self.bitmap.font.color  = Color.new(0,0,0)
    self.bitmap.draw_text(1,1,96,32,s.to_s,1)
    self.bitmap.font.color = c     
    self.bitmap.draw_text(0,0,96,32,s.to_s,1)
    interpreter = $game_map.respond_to?(:interpreter) ?
        $game_map.interpreter : $game_system.map_interpreter
    character = id.is_a?(Game_Character) ? id : interpreter.get_character(id)
    self.x = character.screen_x - 48 - r + 2*rand(r)
    self.y = character.screen_y - 48 - r + 2*rand(r)
    (self.z = 1000) && (@opac = 0)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    (self.opacity -= (self.y-=2) && (@opac+=0.5)) && super unless disposed?
  end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs the map screen processing.
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  $@ || alias_method(:damage_pop_up_main, :main)
  $@ || alias_method(:damage_pop_up_update, :update)
  #--------------------------------------------------------------------------
  # * Main
  #--------------------------------------------------------------------------
  def main(*args)
    damage_pop_up_main(*args)
    @damage.each  { |d| d.disposed? || d.dispose }
  end
  #--------------------------------------------------------------------------
  # * Damage
  #--------------------------------------------------------------------------
  def damage(id = -1, s = "", r = 0, c = Color.new(255,255,255))
    c = Color.new(*c) if c.is_a?(Array)
    (@damage||=[]) << Damage_String.new(id, s, r, c)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update(*args)
    (@damage||=[]).reject! {|d| d.is_a?(Sprite) == false || d.disposed? }
    (@damage||=[]).each    {|d| d.opacity == 0 ? d.dispose : d.update }
    damage_pop_up_update(*args)
  end
end
Here's the script(Sorry I could not find the link which I used to download)
This type of Game_Interpreter error refers to mistakes done in writing an in-event script-command or script-condition, and #screen_x seen in the code you posted belongs to Game_Character.

So since the error says "nil", the eventoid object reference or ID you're passing over to the function very surely is invalid. Please check carefully what you're pointing at.

~炬燵あ

Original thread: https://forums.rpgmakerweb.com/threads/damage-pop-up-script.171129/