Issue with my script

I’m trying to make a bakery system for my game their a GUI where you choose a batter in when I click the button on what battle I suppose to make that part in the tray Transparency to 0 but when I click what batter I want nothing happens here my script local Gui = script.Parent
local Tool = game.Lighting.MuffinTray

local defaultColor = Color3.new(1, 0, 0)
local defaultTransparency = 0

local currentColor = defaultColor
local currentTransparency = defaultTransparency

local function updatePartAppearance()
local toolBase = Tool:FindFirstChild(“Base”)
if toolBase then
local toolModule = toolBase:FindFirstChild(“Base”)
if toolModule then
local toolParts = toolModule:GetDescendants()
for _, part in ipairs(toolParts) do
if part:IsA(“BasePart”) then
part.BrickColor = BrickColor.new(currentColor)
part.Transparency = currentTransparency
end
end
end
end
end

local button = Gui:WaitForChild(“chocolate”)
button.MouseButton1Click:Connect(function()
if currentColor == defaultColor then
currentColor = Color3.new(0.34, 0.16, 0.09)
currentTransparency = 0.5
else
currentColor = defaultColor
currentTransparency = defaultTransparency
end

updatePartAppearance()

end)

updatePartAppearance()

This topic was automatically closed after 7 days. New replies are no longer allowed.