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

How do you check a GUI's current size?

I have an if statement trying to check a GUI's size but I'm obviously not doing something right.

if GUIBar.Size == UDim2.new(1, 0, 1, 0) then
	print("Max Size")
end	

1 comment

0

This question needs more context. There is nothing wrong with how it is set up.

1 answer

✓ Accepted answer

Hello,

I started by printing the Gui.Size then I made a little bit of thinking and arrived at this:

local player = game.Players.LocalPlayer
local pgui = script.Parent
local gui = pgui.ScreenGui
local f = gui.Frame -- My frame.

if f.Size == (UDim2.new(0,100,0,100)) then --It needs to be 3 S.F(significant figures)
	print("MAX")
end

I am still learning RbxLua.

Thank you for reading.

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