I was wondering how i would get something to print when something from the players character gets removed i.e Hats. I have tried using the changed event but it does not do it. Here is something i have tried.
game.Players.PlayerAdded:connect(function(player) game.Workspace:FindFirstChild(player.Name).Changed:connect(function(Chang) --Stuff end end
The Changed
events only fires when an Object's properties change. To catch children being removed, use the DescendantRemoving
event.
Additionally, your code will only catch changes on the player's first Character: it won't work if they respawn. To fix that, we use the CharacterAdded
Event of Player objects:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character.DescendantRemoving:connect(function(obj) print(obj.Name) end) end) end)