Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Help with my script?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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

0
You forgot to put the last end for the event/function (a 'end)' at after those 3 'ends'). TheeDeathCaster 2368 — 9y
0
Thanks! UrsusLuciusBatiatus 15 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago
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

Ad

Answer this question