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:
You did UDim2 and should have done UDim2.new
while wait() do if script.Parent.Position == UDim2.new(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