Remove Player Hp Via Script call(Resolved)

Guys  fixed the code up to were I needed it to, and it is working now, this topic can be locked.


If I wanted to remove some hp from a actor I would use the script call


$gameActors.actor(actorId).gainHp(-3)


The actor Id would be the number under the actor tab correct so 0001 would be the first actor


How I have my event set up is below.

Code:
◆Control Switches:#0891 DunShroom Atk = ON
◆Show Animation:This Event, Slash Physical
◆Control Variables:#0012 dungeon_ShroomHp -= player_att
◆If:dungeon_ShroomHp ≤ 0
  ◆Control Switches:#0011 MushRoom HUD  = OFF
  ◆Control Switches:#0891 DunShroom Atk = OFF
  ◆Erase Event
  ◆Control Variables:#0012 dungeon_ShroomHp = dunngeon_ShroomMaxHp
  ◆Change EXP:Harold, + 5 (Show Level Up)
  ◆If:extermation hud is ON
    ◆Control Variables:#0021 Extermantion  += 1
    ◆
  :End
  ◆
:Else
  ◆Loop
    ◆If:DunShroom Atk is ON
      ◆Set Movement Route:This Event
      :                  :◇Move toward Player
      :                  :◇Move toward Player
      :                  :◇Move toward Player
      :                  :◇Script:$gameActors.actor(0001 Harold).gainHp(-3)
      ◆Set Movement Route:This Event
      :                  :◇Wait:60 frames
      ◆Set Movement Route:This Event
      :                  :◇Move toward Player
      :                  :◇Move toward Player
      :                  :◇Move toward Player
      ◆
    :End
    ◆
  :Repeat Above
  ◆
:End

Original thread: https://forums.rpgmakerweb.com/threads/remove-player-hp-via-script-call-resolved.67934/