I have this chunk of code:
while wait() do
if script.Parent.Position == UDim2(0.5,-150,0.5,-100) then
print("werked")
script.Parent.Parent.Top.Visible = true
script.Parent.Parent.Bottom.Visible = true
for i = 1,20 do
wait()
print("running")
script.Parent.Parent.Top.Img.ImageTransparency = script.Parent.Parent.Top.Img.ImageTransparency -.05
script.Parent.Parent.Bottom.Img.ImageTransparency = script.Parent.Parent.Bottom.Img.ImageTransparency -.05
end
end
end
It is meant to check if a certain frame is in a certain position, but I keep getting the error that UDim2 is not a 'table value'. Is there a certain way to do this, or can you not do this? Thanks. Also, please help my reputation, someone downvote spammed me D:

1 comment
Your second line, change UDim2 to UDim2.new