local plr = game.Players.LocalPlayer
local PlayerGui = plr:WaitForChild('PlayerGui')
-
local ScreenGui = PlayerGui:WaitForChild('1stLoadingScreen') --ScreenGui
local StartButton = ScreenGui.Frame.PlayLabel -- A TextLabel
spawn(function()
StartButton:GetPropertyChangedSignal('Size'):Connect(function()
if StartButton.Size >= UDim2.new(0.1,0,0.1,0) then -- THIS IS WHERE THE PROblEM OCCURS
print('it is past that ')
end
end)
end)
spawn(function()
while wait(.1) do
StartButton.Size = StartButton.Size + UDim2.new(.01,0,.01,0)
end
end)
COMMUNITY QUESTION
Attempt to compare two userdata values pls help?
1 answer
StartButton.Size is a userdata value indeed, you cannot compare a UDim2 to it because it is not a number or integer, in which you can only compare those, same goes for stuff such as Vector3 and CFrame
A easy solution to this however, is to add
if StartButton.Size.X.Scale >= 0.1 and StartButton.Size.Y.Scale >= 0.1 then
--DO THIS
Due to UDim2 not being a data TYPE of a, "Number," it does not know what to compare to, but if you index down to, "X," or, "Y," it will automatically see X or Y as a number, and not a UDim2
1 comment
0
Obviously, if you need the conditions for the if statement changed, use the same format with the X and Y axis, i.e, "or," and not, "and,"
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Might I suggest comparing AbsoluteSize coordinates. You can not compare an entire UDim2 to another UDim2, you must treat it as X and Y coordinates. UDim2.new(XScale, XOffset, YScale, YOffset)
ud2.X.Scale, ud2.X.Offset, ect ect