local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
local d
local c
local cA
wait(1)
cA = player.CharacterAppearanceLoaded:Connect(function(character)
end)
c = player.Backpack.ChildAdded:Connect(function(newTool)
wait(.1)
print("tool")
end)
d = players.PlayerRemoving:Connect(function(player)
print("player removing #1")
print(c)
if c then
c:Disconnect()
print('discon')
end
print(c)
if d then
d:Disconnect()
end
if cA then
cA:Disconnect()
end
end)
end)
players.PlayerRemoving:Connect(function(player)
print("player removing #2")
end)
I’m trying to figure out the setup to disconnect events after the player leaves to make sure there isn’t a memory leak. I came across something weird that seems like it should be common sense. Neither of the “player removing” print at all. What am I overlooking?