Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

ImageLabel Rotation help?

Asked by
Vividex 162
10 years ago

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

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago

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)
Ad

Answer this question