Goal To print something if one of the button in the GUI is clicked. Problem I don't know what I'm doing wrong, each time I click one of the button the print keep duplicating. I suppose it's because I'm firing all of them every time one is pressed, but I don't know how I should prevent that, please help. Script ```lua local function PressedColor(ColorB) ColorB.MouseButton1Click:Connect(function() print(ColorB) script.Parent.Enabled = false end) end
UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.F then script.Parent.Enabled = true PressedColor(PurpleB) PressedColor(BlackB) PressedColor(RedB) PressedColor(BlueB) PressedColor(YellowB) PressedColor(GreenB) end end)
UIS.InputEnded:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.F then script.Parent.Enabled = false end end) ```