Receive an event when the orientation of a part change

Hi! I would like to know how to receive an event when the orientation of a part change.

[part].[rotation changed]:Connect(function([old orientation],[new orientation])
print("orientation on "…[part]…“changed from”…[old orientation]…“to”…[new orientation]…)
end)

Can you help me please?

IIRC you can just compare a value like such;

Part:GetPropertyChangedSignal("Orientation"):Connect(function()
--...
end)

You can also check out this functions documentation here.

Can I get the old orientation value with this script?

I don’t believe this function has the past value it’s changing from to offer, however there is an easy workaround here.

For instance;

local LastOrientation = Vector3.new();

Part:GetPropertyChangedSignal("Orientation"):Connect(function()
--...
LastOrientation = Part.Orientation;
end)

As @Pyritium said, you should do something along that line. Something like this should work:

local Part = game.Workspace.Part -- Change part to your part name.
local oldOrientation = Vector3.new(Part.Orientation)

Part:GetPropertyChangedSignal("Orientation"):Connect(function()
    local newOrientation =
    newOrientation = Vector3.new(Part.Orientation)

    print(tostring(newOrientation))
end)

Now I am not that experienced with Vectors, however if you have any problems, let me know!