You can't have two on text events in the same script.

Either combine them into one on text script or put the second one into another script file.

You are also missing a ) at the end of this line:
Code:
var %i = $r(1,$hget(,0).item