Onix is dual Rock/Ground. I'm not sure if Onix was ground type in Gen I games but I do remember using my Pikachu against Geodude and Onix and they were unaffected by electric attacks.. Granted the water from the leaking pipes could have been the thing that did Onix in instead of the electricity. Pikachu also managed to defeat Roark's Onix. Again this could be due to the electricity breaking the rocks which hit Onix. From what I observed attacks can be used to turn other objects around the battlefield into weapons to overcome type weakness. Which of course doesn't happen in the games!