well you could get by the +k if you check if ($2 ison $chan) then do +k nick if ($2 !ison $chan) mode $chan +k $2