well it depends on a few factors. Is this code in the cube or the player? If its on the cube, then the caller must have authority, so it has to have ownership of the cube.
Also make sure that the cubes actor is set to allow replication.
If this code exists in a component, make sure to set the component to allow replication as well.