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

Sizing GUI Frame doesn't change Y values?

Asked by 6 years ago
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

Log in to vote
0
Answered by
FazNook 61
6 years ago
Edited 6 years ago

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
Ad
Log in to vote
0
Answered by
Wiscript 622 Moderation Voter
6 years ago
Edited 6 years ago

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

Answer this question