After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Frame = Instance.new("Frame")
local P = script.Parent.Position
local S = script.Parent.Size
local A = script.Parent.AnchorPoint
Frame.Parent = script.Parent.Parent
Frame.Size = S
Frame.AnchorPoint = A
Frame.BackgroundColor3 = Color3.new(1, 0, 0)
Frame.Position = P - UDim2.new(0, 0, P.Y.Scale - P.Y.Scale, 0)
print(Frame.Position)
You have to get the y scale of the frame and then divide by 2 (assuming the AnchorPoint for the Frame is in the center) then add that to the Y position of the frame. Something like:
Just wanted to add, you can do this pretty easy by making the new frame the child of the old frame. Just make sure that the position is set to {0, 0},{1, 0} and anchor point is 0,0
and if you wanted the new frame to be the same size as the old one, you would make the size of the new frame {1, 0},{1, 0}
Not sure if making the new frame a child of the new frame is an option for you in this circumstance, but it would work.