could be a few issues. one the power plug on the laptop is going bad..broken solider joint. the battery or ac brick is going bad..most time with age it the battery that fails. check the ac brick and it cables..if you twisted them a lot over time you can snap the wires inside. the last if it not the battery is the system board on the laptop charging parts are going bad.