Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to replace a Frame with another gui?

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

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

1 comment

0

Thankyou @AntoninFearless

This discussion is preserved as it was. New answers, comments, and votes are closed.