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

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

Asked by 4 years ago
Edited 4 years ago

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
0
wait.. does .Magnitude work with UDim2?, you can try that.. greatneil80 2647 — 4y
0
No Magnitude doesnt work with UDim2 Zeppelin0330 38 — 4y
0
Try if script.Parent.Size <= Udim2(whatever size here) kom297 -4 — 4y

1 answer

Log in to vote
0
Answered by
kom297 -4
4 years ago

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
0
Unfortunately I receive an error that says attempt to compare userdata Zeppelin0330 38 — 4y
Ad

Answer this question