Glowing effect cycle: in a datapack

I have seen a mini game concept and I want to recreate it in a datapack, I already made the system that give an id for each player with a scoreboard, the part i dont know to make is the glowing effect that "passes" on players : the effect is given to the player 1 and 1 tick after it is cleared to player one and given to player 2 and 1 tick after it's with player 2 and 3 etc... I want it to calculate the number of players and give the right function. Sorry for my bad explanation (Im not here to promote but the mini game name is ||mace roulette if you want to get the idea you can search on youtube||)

Continue to help post