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

How to know if a Frame is more or equal to a UDim2?

Hi guys! I want to create a UI animation, but I want write that -->

if WeaponWheel.Size > UDim2.new(0.5, 0, 0.5, 0) then

But it's not work!

Players.NiniBlackJackQc.PlayerGui.BackpackUI.WeaponWheel.ClientScript:39: attempt to compare two userdata values

So? How to fix that?

I'm not speak english, so sorry for my grammar mistakes and for less information

1 comment

0

You could compare the X, Y, Width, and Height of the frame.

1 answer

✓ Accepted answer

Compare each component:

local xS = 0.5
local xO = 0
local yS = 0.5
local y0 = 0

local w = WeaponWheel.Size

if w.X.Scale >= xS and w.X.Offset >= x0 and w.Y.Scale >= yS and w.Y.Offset >= y0 then
   -- run code
end

1 comment

0

Yes it's a great idea, thank you!

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