I have this chunk of code:
01 | while wait() do |
02 | if script.Parent.Position = = UDim 2 ( 0.5 ,- 150 , 0.5 ,- 100 ) then |
03 | print ( "werked" ) |
04 | script.Parent.Parent.Top.Visible = true |
05 | script.Parent.Parent.Bottom.Visible = true |
06 | for i = 1 , 20 do |
07 | wait() |
08 | print ( "running" ) |
09 | script.Parent.Parent.Top.Img.ImageTransparency = script.Parent.Parent.Top.Img.ImageTransparency -. 05 |
10 | script.Parent.Parent.Bottom.Img.ImageTransparency = script.Parent.Parent.Bottom.Img.ImageTransparency -. 05 |
11 | end |
12 | end |
13 | 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
01 | while wait() do |
02 | if script.Parent.Position = = UDim 2. new( 0.5 ,- 150 , 0.5 ,- 100 ) then |
03 | print ( "werked" ) |
04 | script.Parent.Parent.Top.Visible = true |
05 | script.Parent.Parent.Bottom.Visible = true |
06 | for i = 1 , 20 do |
07 | wait() |
08 | print ( "running" ) |
09 | script.Parent.Parent.Top.Img.ImageTransparency = script.Parent.Parent.Top.Img.ImageTransparency -. 05 |
10 | script.Parent.Parent.Bottom.Img.ImageTransparency = script.Parent.Parent.Bottom.Img.ImageTransparency -. 05 |
11 | end |
12 | end |
13 | end |