i have some steps that you must do if you whant to shoot lightning.
step 1: do /give @p command_block.
step 2: copy the first command and paste it into the commnad block.
step 3:make a wery fast redstone clock thats runing into the command block.
if you whant to pick the arrow up or wait until the arrow de-spawns just skip the 4. step.
step 4:copy the second command and paste it into a command block you can place the command block 7 blocks away from the other
command block when you have paste the second command into the second command block make a wery wery wery slow redston clock
thats runing into the second command block
step 5: we are now dont i hope you like it :)