How do u use an if-then statement with UDim2, CFrame, Size or Vector3? How exactly do I make an if-then statement so it basically will check if a Size is at whatever Size it needs to, to run the code under the if-then statement? I tried and because of it being a Table value I couldn't figure out how to do it exactly. Here are my attempts lol
lua
if Popups.Mine.Fill.Size == {1,4,0,0} then
got no response
lua
Popups.Mine.Fill.Size == UDim2{1,4,0,0} then
got an error attempt to call global 'UDim2' (a table value)
lua
Popups.Mine.Fill.Size == UDim2.new(1,4,0,0) then
also got no response
That would be easy
For CFrame, Vector3, UDim2
if game.Workspace.Part.CFrame==CFrame.new(0,0,0) then -- FOR CFRAME -- BLOCK OF CODE end if game.Workspace.Part.Size==Vector3.new(0,0,0) then -- FOR VECTOR3 -- BLOCK OF CODE end if game.StarterGui.ScreenGui.TextLabel.Size==UDim2.new(0,0,0,0) then -- FOR UDIM2 -- BLOCK OF CODE end
Hope this helped you :)
You can just check the individual values
if GUI.Size.X.Scale == 1 and GUI.Size.X.Offset == 4 and GUI.Size.Y.Scale == 0 GUI.Size.Y.Offset == 0 then
Even though I'm pretty sure your last method should have worked