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

how do i change size of a frame roblox with script?

i made this script to change the size of an Frame or a gui

problem: the script i made seems to not work it does not change the size of a "Frame"

my code:

Frame = script.Parent.Frame
Frame.Size = ({0.129, 0},{0.23, 0})

1 answer

✓ Accepted answer

Hello Retal!

First off, you need to ensure that this is inside of a LocalScript inside of the StarterGui, or a child in the StarterGui.

When changing the size of a GuiObject you have to use UDim2. The reason is because GuiObject.Size uses a value type of UDim2.

In your instance, your script should look like this:

local frame = script.Parent:WaitForChild('Frame')
frame.Size = UDim2.new(0.129, 0, 0.23, 0)

You can read up on GuiObject.Size here!

Merry scripting!

4 comments

0

Be sure to mark this as the answer if it helps you!

0

Thank you @Rinextel

0

No problem! Good luck!

0

Thanks!

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