Download the script.
Go to your ~/.xchat2 folder and extract the archive, you will have then an subfolder called scripts with the tts.pl script and a subfolder called tts where the script store its data in it.
You can load it in XChat then with /load ~/.xchat2/scripts/tts.pl
If you want to have the script loaded automaticly with Xchat cd to your ~.xchat2 folder and make a symlink to the script:
ln -s scripts/tts.pl