Working with collision group, feel like something's off

So I’ve worked on this, and I think like something’s off in what I’ve written.

Specifically the scripts where I work with collision groups, they all seem jumbled up to me, but I have no idea how else to write them.

Basically, there is a gameRoundScript which is a simple round script that teleports players into the map after 5 seconds, waits 30 seconds then teleports them back.

There is also a playerCollision script that uses the collisionManager script to set the players’ collision groups to “Players”. Then it uses descendantAdded and reads from currentPlayerCollisionGroup to get the collision group the descendant should be changed to, and changes it to that, so that if a descendant is added, its collision group changes to the player’s collision group.

But then in the gameRoundsScript, I need to change the players’ collision group to another one, so I use collisionManager to do that, and I change currentPlayerCollisionGroup in playerCollision script so the new descendants get added to the right collision group.

Project.rbxl (32.8 KB)

I feel like I’m doing everything wrong.