Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with my script?

For some reason it's not working, any tips?

script.Parent.MouseButton1Click:connect(function() for _,v in pairs(game.Workspace:GetChildren()) do for _,x in pairs(game.ReplicatedStorage.Items:GetChildren()) do if v.Name == x.Name then v:Destroy() end end end

2 comments

0

You forgot to put the last end for the event/function (a 'end)' at after those 3 'ends').

0

Thanks!

1 answer

✓ Accepted answer
script.Parent.MouseButton1Click:connect(function()
	 for _,v in pairs(game.Workspace:GetChildren()) do 
		for _,x in pairs(game.ReplicatedStorage.Items:GetChildren()) do 
			if v.Name == x.Name then
				v:Destroy() 
			end
		end 
	end 
end

That should work. You were just missing an end.

Is this helps then please up-vote and Accept the answer to help others with the same question

This discussion is preserved as it was. New answers, comments, and votes are closed.