How to change the health and shield of all players without changing their teams

The guy that made the code made it in a really weird way for me to change it. Could you give me what the code is supposed to do exactly so I can rewrite it?