Recently I made a script that adds peoples nicknames to it like a list with the format being @nickname, so that it will append it on a single line. I was wondering if there was a way to delete only the text matching their nickname so if we have a list that it will only removing their nickname and not the whole line itself.

Here's the code that writes the list itself.

Code:
on *:TEXT:!addnick:#: {
  if (%nick == open) {
    if (!%addnick. $+ $nick) {
      set -u600 %addnick. $+ $nick on
      .write -al1w"@*" text.txt @ $+ $nick $+ , 
      .msg # @ $+ $nick $- Added to the list!
    }
  }
}