Change: $client variable instead of $player.

Because it can not only be player but also bot.