Need help with scripting

this script it supposed to destroy all the children in the folder every 60 seconds but it is not. can someone help me?
heres the script

local acid = game.Workspace.acidstorage:GetChildren()

while true do
	wait(60)
	acid:destroy()
end
1 Like

You need to go trought every single children and destroy them :

local acid = game.Workspace.acidstorage

while wait(60) do
	for v, Children in pairs(acid:GetChildren()) do
		Children:Destroy()
	end
end

I hope that was helpful have a nice day !

5 Likes

@FireStrykerAzul’s solution should work.

The reason the script you have isn’t working is because you only get the children of the acid folder once at the beginning of the script, and then you try to destroy the actual table, instead of each child.

You need to refresh your acid table every 60 seconds, and then destroy each individual part, like his script has.

The only improvement I would make is changing line 3 from while wait(60) do to while task.wait(60) do

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.