Why Is This Red?

Why Is The Code Underlined Red When I Use A + Instead Of = ?

function Next()
	script.Parent.Parent.Destination.Value + 1
end

script.Parent.ClickDetector.MouseClick:Connect(Next)
1 Like
function Next()
	script.Parent.Parent.Destination.Value = script.Parent.Parent.Destination.Value + 1
end

script.Parent.ClickDetector.MouseClick:Connect(Next)

Try that instead.

2 Likes

Compound operators are your friend :slight_smile:

function Next()
	script.Parent.Parent.Destination.Value += 1
end

script.Parent.ClickDetector.MouseClick:Connect(Next)

Forgot about that! Thanks! :wink:
I’ll be sure to use them next time!