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
You forgot to put the last end for the event/function (a 'end)' at after those 3 'ends').
Thanks!