You can get a Riolu in the Safari Zone. It's rare and you have to place items that the Pokemon in the Peak like and items that the Pokemon in the Forest like. If you walk in grass, you may find your Riolu. It does not matter what time of day it is. Then, max out its happiness and you will have a Lucario. The easy way is to of course trade from Diamond, Pearl or Platinum.
Source: Bulbapedia
You have to defeat the Elite Four before you can place items.