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

attempt to compare two userdata values when i do > UDim2.new(blah blah blah)?

Asked by 6 years ago
for i,v in pairs(script.Parent.Holder["1"]:GetChildren()) do
            if v.Position < UDim2.new(0.056, 0,0.747, 0) then -- or > still didn't work
                v:Destroy()
            end
        end

error: attempt to compare two userdata values

idk what's the reason i just wanna fix that very quick

0
Try using magnitude so like v.Position.magnitude or try do v.Position.X < and then make like a part with that position and link to the X value of that. It might work :D DumbKickButt5588 167 — 6y
0
That won't work he is using GUI objects not parts. GetGlobals 343 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I can't confirm this as a working solution since this is sort of guess work..

local function Compare(UDim1,UDim2)
local xs1 = UDim1.X.Scale
local ys1 = UDim1.Y.Scale
local xs2 = UDim2.X.Scale
local ys2 = UDim2.Y.Scale
if xs1 > xs2 and ys1 > ys2 then
return true
end
end
for i,v in pairs(script.Parent.Holder["1"]:GetChildren()) do
            if Compare(v.Position,UDim2.new(0.056, 0,0.747, 0)) then -- or > still didn't work
                v:Destroy()
            end
        end
Ad

Answer this question