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

Sizing GUI Frame doesn't change Y values?

while true do
	wait()
	local xsize = script.Parent.Parent.Size.X
	script.Parent.Size = UDim2.new(xsize,0,20)
end

So, i'm changing the size of a frame, and here's the issue

the size for the gui changes to {0,xsize},{0,0} the Y won't change to 20 like defined.

2 answers

I made this script on my phone, so it might be subject to errors. Let me know if it does.

while true do()
wait()
local xs = script.Parent.Parent.Size.X
script.Parent.Size = UDim2.new(xs.., 20, 0)
end

Try this out

while true do
    local xsizescale = script.Parent.Parent.Size.X.Scale
    local xsizeoffset = script.Parent.Parent.Size.X.Offset
    script.Parent.Size = UDim2.new(xsizescale,xsizeoffset,0,20)
    wait(2)
end

Also, there's no need for the while loop in this situation. You could simply just use the code within.

local xsizescale = script.Parent.Parent.Size.X.Scale
local xsizeoffset = script.Parent.Parent.Size.X.Offset
script.Parent.Size = UDim2.new(xsizescale,xsizeoffset,0,20)

Hope I helped ya out

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