The Axiom of Specification says that:
For a set $ A$ and objects $x\in A$,for any object $y$ there exists a set: $$ y \in \{x: P(x) \wedge x \in A\} \implies y \in A \text{ and } P(y)$$
Where $P(x)$ is a statement pertaining to $x$.
The Axiom of Replacement says that:
For a set $ A$ and objects $x\in A$,for any object y, suppose we have a statement $P(x,y)$, pertaining to $x$ and $y$ such that for each $x$ there is at most one $y$ for which $P(x,y)$ is true, then there exists a set, such that for any object z, $$ z\in \{y:P(x,y) \text{ s.t } x \in A \} \implies P(x,z) \text{ for } x \in A$$
I can see that the AOR is stronger than the AOS. If we let $P(x,y)$ be whether $y$ is in the same set as $x$ then $P(x,y)$ is a true of false statement and hence it will follow that if $P(x,y)$ is true then $ y \in A \text{ and } P(y)$. Does this hold any water?
I have sketched diagrams, to try and motivate a solution but have failed.
I am editing this question simply because I don't understand the answers to the other posts. ( I have tried...) So I am going to add an answer to mine.
MY ATTEMPT:
Let A be a set, then for any object $y$ let $\gamma$ be defined as follows:
$$\gamma(x) = x \text{ if } \theta(x) \text{ for } x \in A$$ $$\gamma(x) = y \text{ if } !\theta(x) \text{ for } x \in A$$
Then by the Axiom of replacement There exists a set $B$ such that
$$B = \{\gamma(x): x \in A, \gamma(x) = x\} = \{x:\theta(x), x \in A\}$$
The last set in the above statement implies the Axiom of separation.