Introducing the Luau VM memory exploration tools

You can take the connection returned by Connect and use that object to disconnect in PlayerRemoving signal.

Alternatively, if this on the server, you can try auto-destroy of Player and Character using this property: New Player and Character Destroy Behavior
(if it doesn’t break something in the experience)

One other option is to not capture outer variables like ‘Player’ argument from inside the connection, but this is not always possible.

1 Like