To do the connect thing, I recommend you use this:
game.Players.PlayedAdded:Connect(function(player)
player.CharacterRemoving:Connect(function()
--here you remove the effects
end
end)
If you want to remove the effect client-side that are in workspace, I recommend you use CollectionService to tag them so you can just get them instantly instead of having to loop through the entire workspace. To use the full power of CollectionService, get this plugin: Tag Editor - Roblox.