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
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