Score=0 if workspace.PartScoreBoard.SurfaceGui.Frame.Pin1.BackgroundColor3 == Color3(1, 0, 1) then Score = +1 end
I'm trying to add to the value when when the color of a certain background turns pink.
But so far I'm not getting anywhere, how Do I add to score when something happens?
What you did wrong was say Score = +1 which basically means it equals positive 1. When adding to a value you must index it again after the = sign.
Score=0 if workspace.PartScoreBoard.SurfaceGui.Frame.Pin1.BackgroundColor3 == Color3(1, 0, 1) then Score = Score + 1 print(Score) end
Some extra examples of adding to values IntValues:
local IntVal = script.IntValue --setting a variable for an IntValue located under the script IntVal.Value = IntVal.Value + 10 --Adding 10 to the value