Even better solution (in my honest opinion). Use the CollectionService. Any object that belongs to a player or is created by them, tag it with their username. Then, upon the player’s leaving, simply destroy any objects tagged as such.
This prevents you from needing to rely on a folder as your dependency. You should aim to use as little dependencies as possible. A folder is somewhat restricting in terms of objects in the game hierarchy.
local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")
Players.PlayerRemoving:Connect(function (Player)
for _, item in pairs(CollectionService:GetTagged(Player.Name)) do
item:Destroy()
end
end)
-- Example code
CollectionService:AddTag(workspace.Baseplate, somePlayerName)