Wispy, he's got more issue than your small concern. Again, you're trying to argue a tiny thing with a lack of experience.
Yes, it should work.
Caustic, I'm going to only outline some major notes here, not do like many others and totally re-write the code and post it.
One, I'm lazy that way.
Two, I learn better by trying to learn from key points than someone just posting some finished project in front of me that didn't show me how to get there.
I'm in hopes you'll be the same. Work from the information given, see new errors, fix what errors you can/understand, go from there.
1) Your command object setup - you'll need another addParam adding a number, if that's indeed what 'level' ranking is, just a number/integer input. ulx slap is a perfect example showing how to add a number.
2) Your command object setup - Ulib.cmds.PlayerArg is a SINGLE player selection/input that expects a single player object target, and, you name your variable in the function as it's passed as though it's going to be single (target_ply), BUT, you then take code from ?somewhere? that loops through an expected table as though you were using Ulib.cmds.PlayersArg.
Pick one or the other. If single, no loop needed.
If multiple targets, do the loop.
3) Well, #2 really defines this. You're currently looping a single player object.
More will come as you decide your choices of multi or single target.