if Distance.X > 1.8 then Motor6D1.Transform = Motor6D1.Transform Motor6D2.Transform = Motor6D2.Transform elseif Distance.X < 0 then Motor6D1.Transform = Motor6D1.Transform Motor6D2.Transform = Motor6D2.Transform else Motor6D1.Transform = Motor6D1.Transform * CFrame.Angles(0,math.rad(Percent + 270),0) Motor6D2.Transform = CFrame.Angles(math.rad(Percent + 270)*2,Motor6D2.Transform.Y,Motor6D2.Transform.Z) end
Ok, this script basically coverts a part
's position
into Motor6D
Rotation in two CFrames
. This bit of code does not show some of the variables, but they are self-explanitory. I need a way to have limits, so it cant rotate
past a certain point. How could I do this? Any help will be greatly appreciated!