On on nick event doesn't have a #/$chan. Something like that would return $Null. you will have to use $comchan. the simplest script you can use is $comchan($newnick,1). However i would suggest a loop:
var %x = 1
while ($comchan($newnick,%x)) {
ban -k $v1 $newnick badnick
inc %x
}
Actually # is evulated as the current channel being in the reason why his script might not work is because he has set where ON NICK change he has a IF statement that starts immediately for the check, now if the newnick is not identified immediately that string is useless.
A simple 5-10 second timer in between should do you wonders.
also to note that your ON NICK is set if OP + so do note that when testing that the testing nick is an operator.
on @*:NICK: {
[color:red]timer 1 5 {[/color]
if ($newnick isreg #) {
if ($level($newnick) == badnick ) { .signal -n d $1 $newnick }
Haltdef
}
}
[color:red]}[/color]
on *:signal:*: {
if ($signal == d) {
!.quote -q kick $1 $newnick $3
}
}
user ..
badnick:*abc*