You need to get a reference from your HUD to a class the server also has, such as the Player Controller or Pawn/Character.
So, OnClick gets the local pawn which can then get the local player controller, which then can call a server function, which will then replicate because the server and client both have a copy of the player controller.