How To Make A Crate Spin Effect System

I am trying to make a crate system like this: Creating a Crate/Spin System

The problem is, that I want a continuous spinning loop effect where it cycles through each crate and transitions seamlessly to the beginning. I tried doing this with a while loop. However, frame rates affect the speed and the transition is not 100% seamless. Is there any way to seamlessly create a transition whilst making sure it is smooth throughout no matter the frame rate? (Low and high fps for fps unlockers)

What hasn’t worked (My current script):

task.spawn(function()
	while task.wait() do
		if (RerollFrame.Visible == true and isSpinning == false) then
			if (HolderFrame:FindFirstChild("Crate2").AbsolutePosition.X + (HolderFrame:FindFirstChild("Crate2").AbsoluteSize.X/2)) >= RerollFrame.Center.AbsolutePosition.X then
				HolderFrame.Position = UDim2.fromScale(-0.005,0);
			else
				HolderFrame.Position += UDim2.fromScale(0.005, 0);
			end;
		elseif (isSpinning == false) then
			HolderFrame.Position = UDim2.fromScale(0,0);
		end;
	end;
end);