I have a script that is working kind of strangely. It is announcing subscriptions without a problem, but it is also announcing the sub message for resubs and gift subs as well. So when someone resubs it triggers the sub message and the resub message. The sub message is also oddly triggered on raids as well.

Code:
ON *:CONNECT: {
  raw CAP REQ :twitch.tv/membership 
  raw CAP REQ :twitch.tv/commands 
  raw CAP REQ :twitch.tv/tags 
} 

raw USERNOTICE:*:{
  if(($msgtags(msg-id).key == sub)&&($1 == #averagemark)){
  var %nick $iif($msgtags(display-name).key,$v1,$msgtags(login).key)
  describe $1 THANK YOU %nick FOR SUBSCRIBING!! Welcome to the AVGFAM!! averag3Sip nickmercsLG nickmercsSUB
}
elseif(($msgtags(msg-id).key == resub)&&($1 == #averagemark)){
var %nick $iif($msgtags(display-name).key,$v1,$msgtags(login).key)
if ($0 == 1) {
  describe $1 THANK YOU %nick FOR THE $msgtags(msg-param-months).key MONTHS IN A ROW! averag3Sip nickmercsLG nickmercsSUB
}
else {
  describe $1 THANK YOU %nick FOR THE $msgtags(msg-param-months).key MONTHS IN A ROW! averag3Sip nickmercsLG nickmercsSUB Left a note: $qt($2-) 
}
}
}