My peak script actually works. There is only 1 problem. When bot joins a channel and it have no variable peak for current channel it should auto set a variable with peak, but it doesnt :S whats wrong in the script?

on *:join:#: {

if (!%peak. [ $+ [ $chan ] ]) {
set %peak. $+ $chan 0
}
if ($nick($chan,0) > %peak. [ $+ [ $chan ] ]) {
set %peak. $+ $chan $ifmatch
}
}
on *:text:.peak:#: {

if (!%peakspam. [ $+ [ $chan ] ]) {
set -u10 %peakspam. $+ $chan 1
msg $chan User peak for $chan is: %peak. [ $+ [ $chan ] ]
}
}