Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I change the size of a frame?

Asked by 4 years ago

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)
0
use game.Players.localPlayer.PlayerGui.ScreenGui.Frame Players can see what happens in starter gui lon233bcc 31 — 4y

1 answer

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

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)
0
It worked! Thank you. TrustedInstaIler 17 — 4y
Ad

Answer this question