i am just trying to replace a Frame with a ImageLabel via a script, by replacing this is what i mean: keeps position, keeps size, Keeps the parent and what in inside the Frame
✓ ANSWER ACCEPTED
How to replace a Frame with another gui?
1 answer
✓ Accepted answer
Yep, here you go:
local Frame = script.Parent:WaitForChild("Frame")
local Replacement = Instance.new("ImageLabel",script.Parent)
Replacement.Size = Frame.Size
Replacement.Position = Frame.Position
for i,v in pairs(Frame:GetChildren()) do
v.Parent = Replacement
end
Frame:Destroy()
If you ever need an explanation you could simply comment to ask for it
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thankyou @AntoninFearless