How to make this work on dummies/rigs too

So im trying to make a spell that will push all players away but what im using is a for i loops through the players to get their children and do it but that makes it only work on them what if I want to make it work on dummies, How can I do that? I thought of perhaps looping through the workspace if any model has a humanoid but is that what other popular games do? or is there another better way. Any help is appreciated :raised_hands: