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 the size of a frame?

For some reason, I get a error upon trying to change a size of a frame with a script. Neither of these work: UDim2 and UDim. So how can I change a size of a frame using a script if UDim/UDim2 won't work? Is it meant for position. Is there a UDim2/UDim meant specifically for the size property? Help? This is the code I'm using:

-- This code doesn't work --
game.StarterGui.ScreenGui.Frame.Size = UDim2(1, 0, 1, 0)
-- Neither does this work --
game.StarterGui.ScreenGui.Frame.Size = UDim(1, 0, 1, 0)

1 comment

0

use game.Players.localPlayer.PlayerGui.ScreenGui.Frame Players can see what happens in starter gui

1 answer

✓ Accepted answer

Size is a UDim2 value and you are creating a new UDim2 value so you'd use UDim2.new()

game.StarterGui.ScreenGui.Frame.Size = UDim2.new(1, 0, 1, 0)
game.StarterGui.ScreenGui.Frame.Size = UDim2.new(1, 0, 1, 0)

1 comment

0

It worked! Thank you.

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