local Position = Vector3.new(0, 0, 0)
local Size = Vector3.new(4, 4, 4)
local RF = Position + Vector3.new(Size.X/2, -Size.Y/2, -Size.Z/2)
local LF = Position + Vector3.new(-Size.X/2, -Size.Y/2, -Size.Z/2)
local RB = Position + Vector3.new(Size.X/2, Size.Y/2, Size.Z/2)
local LB = Position + Vector3.new(-Size.X/2, Size.Y/2, Size.Z/2)
local center = (RF + LF + RB + LB) / 4
local frontVector = (RF - LF).unit
local rightVector = (RB - RF).unit
local upVector = frontVector:Cross(rightVector).unit
local BodyGyroCFrame = CFrame.fromMatrix(center, rightVector, upVector)
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.CFrame = BodyGyroCFrame
bodyGyro.Parent = yourPart