Could be some problem with the incrementation since the first letter display different letter, or character in game.
Can be solved using ToastofDoom code:
[CODE]
BUILDIN_FUNC(strtolower)
{
const char *str = script_getstr(st,2);
char *output;
int i = 0;