Trying To Delete A part if a string value is something

Nope, it stopped working. This problem is unsolved.

Is there any errors in the output?

No. Sorry bout this and it keeps going back and fourth but it’s fixed again. Idk how… :thinking:

Just a random thought to potentially make this a little cleaner. What if you put all a player’s placed items in a folder named after them and then just had your delete script remove the folder’s children? That way everything is deleted at once and you don’t need a loop to do it. Example:

local player = game:GetService("Players").LocalPlayer
local name = player.Name
local playerFolder = game.Workspace:FindFirstChild(name .. "_items") --Note, this is searching for something with "_items" appended to the end of the player name. i.e: phyouthcenter1_items. When creating the folder, it should be formatted exactly like this.

	script.Parent.MouseButton1Click:Connect(function()
		playerFolder:ClearAllChildren()
	end)

Edit: This is tested and works. If you need help setting up the creation of the folder just let me know.