im experimenting motor6d for cars and use them for rotating wheels, but how do i make a motor6d rotate in a loop?
You could use a for loop, a while loop or others
You can see more on iteration and such here: https://developer.roblox.com/articles/Roblox-Coding-Basics-Loops
And you can see more on Motor6D here: https://developer.roblox.com/api-reference/class/Motor6D
It may be easier to just use hinges though.
You make a Motor6D rotate by setting the MaxVelocity property to something non-zero, and giving the motor a DesiredAngle to seek. It will spin until CurrentAngle reaches DesiredAngle. There should be no code loops setting the C0, C1, or Transform properties directly for the the purposes of making a Motor6D turn, as this completely defeats the ability for the Roblox engine to interpolation the motion smoothly on all clients. There are times when it's perfectly valid and necessary to manipulate the CFrames of a Motor6D, but for simply turning like a motor, it's made to do that without needing scripting updating it every frame.