Same compare :
First value : sidekick.x
greater than
second value: player.x
logic runs when sidekick is on right side of player.
First value : sidekick.x
< less than
second value: player.x
logic runs when sidekick is on left side of player.
You can work this into sidekick variables or states perhaps i.e.
First value : sidekick.x
greater than
second value: player.x
Sidekick.playerside = "right"
and work from there.