I have a question ...please answer

What is the difference between a script writer and a director here on episode .? Or what does each individually do .?

I mean as far as I know, and I could be totally wrong, but script could refer to someone who focuses on dialogue, whereas a director focus on how the actual scene plays out like animations and stuff like that.