If the other ones don’t work, this one should work decently. Keep in mind that if the client pushes, it might look like it is moving, but on the server it is not.
Here’s my code,
local axisToLimt = {true, false, false}
script.Parent:FindFirstChildOfClass("AlignOrientation").Parent.Changed:Connect(function()
if game:GetService("ServerStorage"):FindFirstChildOfClass("AlignOrientation") then
game:GetService("ServerStorage"):FindFirstChildOfClass("AlignOrientation").Parent = script.Parent
end
end)
script.Parent:GetPropertyChangedSignal("Orientation"):Connect(function()
if axisToLimt[1] == true then
script.Parent:FindFirstChildOfClass("AlignOrientation").Parent = game:GetService("ServerStorage")
script.Parent.Orientation = Vector3.new(0, script.Parent.Orientation.Y, script.Parent.Orientation.Z)
elseif axisToLimt[2] == true then
script.Parent:FindFirstChildOfClass("AlignOrientation").Parent = game:GetService("ServerStorage")
script.Parent.Orientation = Vector3.new(script.Parent.Orientation.X, 0, script.Parent.Orientation.Z)
elseif axisToLimt[3] == true then
script.Parent:FindFirstChildOfClass("AlignOrientation").Parent = game:GetService("ServerStorage")
script.Parent.Orientation = Vector3.new(script.Parent.Orientation.X, script.Parent.Orientation.Y, 0)
end
end)
a bit messy because I didn’t refine it, but I hope it helps!