Code:
on @*:text:!topic *:#:{
if $left($nick(#,$nick).pnick,1) !isin % @ & ! . * ~ { topic # $2- }
}

used various prefixes i've come across, so that the code will only work for people who don't have enough priviledges to change the topic.