Im Trying To Make It So When I Click The Textbutton is changes all the parts with the same name to transparency 0 but when i do it, it only changes one of the parts
local tool = game.Players.LocalPlayer.Backpack.Pizza
this is what i did is this wrong? local tool = game.Players.LocalPlayer.Backpack.Pizza
local Onion = tool.Onion
script.Parent.MouseButton1Click:Connect(function()
for i, part in pairs(workspace:GetDescendants()) do
if part.Name == "Onion" then
--do stuff
end
end
Onion.Transparency = 0
local Onion = tool.Onion
script.Parent.MouseButton1Click:Connect(function()
for i, part in pairs(workspace:GetDescendants()) do
if part.Name == "Onion" then
part.Transparency = 0
end
end
end)