Alternate suggestion: use AbsoluteContentSize to adjust the CanvasSize. Do this after the loop.
-- Please oh please make a variable for the ScrollingFrame, I see that you
-- don't have one and rewrite this same line 3+ times.
local scrollingFrame = Platform.Hand.HandGui.ScrollingFrame
-- Anyway, the actual code.
local absoluteContentSize = scrollingFrame.AbsoluteContentSize
scrollingFrame.CanvasSize = UDim2.new(0, absoluteContentSize.X, 1, 0)
Oops, no it’s not. AbsoluteContentSize is a property of UI layouts. For some reason I assumed you were using one (you really should in this case, it would handle the positioning and padding automatically) and also incorrectly stated that it comes from ScrollingFrame. If you have a UIListLayout it will have AbsoluteContentSize that you can use to control the sizing of your frame.