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

How could I check if my Gui's size is at a certain amount?

In my script I have it check if the textlabel size is at a certain amount however it is saying that UDim2 is not a valid member of UDim2? How can I check to see if my Textlabel is the size I want it to be before it does something? It is a local script.

local x = 3	
local cow = ("x/100,9,0,23")
		wait(0.01)
		if script.Parent.Size.UDim2 <= script.Parent.Size.cow then
print("Works")
end

3 comments

0

wait.. does .Magnitude work with UDim2?, you can try that..

0

No Magnitude doesnt work with UDim2

0

Try if script.Parent.Size <= Udim2(whatever size here)

1 answer

Try changing it to if script.Parent.Size rather than script.Parent.Size.UDim2 like this

local x = 3 
local cow = ("x/100,9,0,23")
        wait(0.01)
        if script.Parent.Size <= UDim2.new(put udim2 stuff here) then
print("Works")
end

1 comment

0

Unfortunately I receive an error that says attempt to compare userdata

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