I was working on a script when all of a sudden this really simple line of code (Line 4) stopped working and I removed the line of code and the script worked
function Button (h) if h.Parent:FindFirstChild("Humanoid") then if game.Workspace.Button2.ButtonII.BrickColor == ("BrightRed") then game.Workspace.Button2.ButtonII.BrickColor = ("BrightRed") CurrentValue = Game.Workspace.Value.Value game.Workspace.Value.Value = (CurrentValue + 1) end end end game.Workspace.Button2.ButtonII.Touched:connect(Button)
and the output just says and error occurred
This is how you change the color of a brick
game.Workspace.Button2.ButtonII.BrickColor = BrickColor.new("Red")