So like i am making a Placement system which is almost complete all i need is to know how to remove the player's who left itemholder folder child's Like
To get the Plot's Item holder folder it be like
Plot.PlacedObjects but how do i make it remove all the items instead of like 1?
Code--
local player = game:GetService("Players") local plots = workspace.Plots local function FindPlot(plr) local plotChildren = plots:GetChildren() for i,plt in pairs(plotChildren) do if plt then if plt.Plot.Owner.Value ~= nil then print("Owner Found!") else local pltNm = plt.Name game.ReplicatedStorage.Events.ClientPlot:FireClient(plr, pltNm) plt.Plot.Owner.Value = plr break end end end end player.PlayerAdded:Connect(FindPlot)
Create a PlayerRemoving event; upon firing, call Delete on the object. (If there are multiple objects, I recommend sticking them all into a single container.)