Let's say that I have a tool, and the tool spawns "ToolSpawnedParts" that will be placed on the ground. I made a seperate script that is supposed to be in Workspace. It's supposed to clean up all "ToolSpawnedParts" in Workspace, but it doesn't work. It doesn't say anything in the output, I tried functions, waits, and changed. Can anyone help?

function toolCleanup()
	wait(8)
	workspace:FindChildren("ToolSpawnedParts")
	workspace.ToolSpawnedParts:remove()
end

workspace:connect(toolCleanup)

4 comments

2

Lets begin with your first issue. FindChildren does not exist. Do GetChildren instead. Second issue, :remove() is deprecated. Use Destroy() instead. Last issue, :connect is deprecated. Use :Connect instead. Keep in mind that these are basic issues and I have not solved your issue directly. Here is the wiki to GetChildren. http://wiki.roblox.com/index.php?title=API:Class/Instance/GetChildren

0

@AdvanceCode Awesome! I'll do the rest by myself, but thanks for the help.

0

I forgot the colon in front of Destroy(). It should be :Destroy()

0

Stop sperging out over :connect.