MZ Play SE ONCE after player left clicks mouse

For some reason when I try to set a conditional branch that detects when a player left-clicks, the branch repeats like the condition is met every frame. This same setup works fine with normal button-pressed conditions and even other scripted keybinds work. Is the mouse input always pressed, or am I missing something obvious?
Hi, I hope I can help you, check this method:
JavaScript:
◆If:Script:TouchInput.isPressed()
  ◆Loop
    ◆If:Script:!TouchInput.isPressed()
      ◆Play SE:Bite (90, 100, 0)
      ◆Break Loop
      ◆
    :End
    ◆Wait:10 frames
    ◆
  :Repeat Above
  ◆
:End
◆Wait:10 frames
Frames are to avoid lag with other events in parallel process

About IF with Boolean
!TouchInput.isPressed() if touch/mouse is pressed
TouchInput.isPressed() if touch/mouse is released

Sorry about my bad English.

Edited:
Sorry, I simplified it, it is not necessary to use an Rpg Maker variable for this.

Good luck
Hi, I hope I can help you, check this method:
JavaScript:
◆If:Script:TouchInput.isPressed()
  ◆Loop
    ◆If:Script:!TouchInput.isPressed()
      ◆Play SE:Bite (90, 100, 0)
      ◆Break Loop
      ◆
    :End
    ◆Wait:10 frames
    ◆
  :Repeat Above
  ◆
:End
◆Wait:10 frames
Frames are to avoid lag with other events in parallel process

About IF with Boolean
!TouchInput.isPressed() if touch/mouse is pressed
TouchInput.isPressed() if touch/mouse is released

Sorry about my bad English.

Edited:
Sorry, I simplified it, it is not necessary to use an Rpg Maker variable for this.

Good luck
THIS WORKS! Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/play-se-once-after-player-left-clicks-mouse.139915/