How can I simplify this?

Kind of a side-note here, but the way you are handling players leaving is causing a memory leak.
You’re creating a new connection on the PlayerRemoving event every time a player joins, but you never disconnect any.

You really should only have one connection to this event, and then have that handle all players.

2 Likes