Code:
if self.RotAngle > 6.283185 then
self.RotAngle = self.RotAngle - 6.283185
elseif self.RotAngle < -1.570796 then
self.RotAngle = self.RotAngle + 6.283185
end
I tried it but it didn't work. Though it might work for you.
Try putting an extra 'end' on the end.
Oh and. All credit goes to Abdul.
Not sure if i spelt it right.
Edited: Oh and yeah this should go in the lua forum.