decreasing in which way? Value or element? For value (which would put the one with the most kicks to the top) you will need to add ' -integer -index 1' to the parameters of lsort.
proc pub:test {nick host hand chan arg} {
foreach {x y} [array get ::kick] {
if {[string is integer -s $y]} {
lappend score [list $x $y]
}
}
set i 1
foreach {e} [lsort -decreasing -integer -index 1 $score] {
puthelp "PRIVMSG $chan :$i. [lindex $e 0] with [lindex $e 1] kicks"
if {[incr i] == 10} {break}
}
}
if you wonder why I used 2 foreach... the problem is that array get will not return a proper sublist, but just a list which uneven elements are the names and even ones are the values. So first a proper sublist must be created then we can use lsort to sort it . Change the '== 10' thing to whatever maximum number of results you want .
btw. the is integer check will prevent possible errors to occur in lsort from unproper array values. Since I dont know the script that created it, I wont trust it .