The rotation that is set to 180 does not work and I don't know why. Can i get help?
local Rotate = 0 local Number = math.random(1,2) local Block = script.Parent if(Number == 1) then Rotate = 0 else Rotate = 180 end Block.Rotation = Vector3.new(math.rad(Rotate),0,0)
There is no property called "Rotation" on a Part
.
Change
Block.Rotation= Vector3.new(math.rad(Rotate),0,0)
to
Block.Orientation = Vector3.new(math.rad(Rotate),0,0)
Rotation is "The rotation of the part in degrees for the three axes." The issue here is that you are converting your degrees to radians, but rotation is in degrees. The solution here is to simply remove the radian conversion (math.rad).
Block.Rotation = Vector3.new(Rotate,0,0)