script.Parent.MouseButton1Click:connect(function(onClick) script.Parent.BackgroundTransparency = 0.5 script.Parent.Parent.Inv2.BackgroundTransparency = 0.7 script.Parent.Parent.Inv3.BackgroundTransparency = 0.7 script.Parent.Parent.Inv4.BackgroundTransparency = 0.7 script.Parent.Parent.Inv5.BackgroundTransparency = 0.7 end)
I put this in another button, but when I click it it doesnt make Inv1 go back to 0.7
I didn't test this code, but I think it should be something like this.
local p = script.Parent.Parent local inv = { p.Inv2, p.Inv3, p.Inv4, p.Inv5 } script.Parent.MouseButton1Click:connect(function(onClick) if script.Parent.BackgroundTransparency == 0.7 then script.Parent.BackgroundTransparency = 0.5 for index, value in ipairs(inv) do index.BackgroundColor3 = 0.7 end elseif script.Parent.BackgroundTransparency == 0.5 then script.Parent.BackgroundTransparency = 0.7 end end)