Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ImageLabel Rotation help?

Im trying to rotate an ImageLabel on clicked, nothing happens:

rotate = script.Parent.Rotation

function Begin()
	rotate = rotate + 1
end

script.Parent.MouseButton1Down:connect(Begin)

1 answer

✓ Accepted answer

rotate = script.Parent.Rotation is creating a new variable rotate, getting the value of script.Parent.Rotation and setting rotate to that value. rotate = rotate + 1 changes the variable rotate, which is an independent variable that is not in any way linked to the origin of the value initially given to it.

function Begin()
	script.Parent.Rotation = script.Parent.Rotation + 1
end

script.Parent.MouseButton1Down:connect(Begin)

This discussion is preserved as it was. New answers, comments, and votes are closed.