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

How do you check a GUI's current size?

Asked by 6 years ago

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 
0
This question needs more context. There is nothing wrong with how it is set up. Sekant 20 — 6y

1 answer

Log in to vote
0
Answered by
arshad145 392 Moderation Voter
6 years ago
Edited 6 years ago

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.

Ad

Answer this question