Player Rotation

I’m extremely new to lua, so this question may seem stupid. I looked around in the links at the top of the page but didn’t see anything on this subject.

How would a make a command that rotates a certain player around by a specified number of degrees? Not just the head as I’ve seen in some bits of code, but the entire player?

Thanks in advance.

Edit: The rotation wouldn’t need to be instantaneous either.


Should work on the player too.

Thanks for the help.

Is there a way to set the rotation speed, or is it always instant?

u culd try seting the angfles gradualy

That’s instantly changing the orientation of the entity. To make it rotate over time requires you doing some form of physics to it.
This is the function that would set the rotation speed. Making it rotate over time would require additonal constructs like adding it to a Think or PhysicsSimulate hook.

The player isn’t a physobject. He can just use trig to make the player gradually get their angles set.