JavaScript:
function on_player_say( ) {
me = Entity.GetLocalPlayer()
text = Event.GetString("text")
userid = Event.GetInt("userid")
chatter = Entity.GetEntityFromUserID(userid)
var split_text = text.split("")
var str = ""
if ( Entity.IsEnemy( chatter ) ) {
for ( i = 0; i < split_text.length; i++ )
{
str += split_text[ i ][ Math.round( Math.random( ) ) ? 'toUpperCase' : 'toLowerCase' ]( )
}
Cheat.ExecuteCommand( "say " + str )
}
}
Cheat.RegisterCallback("player_say", "on_player_say")