A little weary of trying this on Studio, would this work?
1 | local n = script.Parent |
2 |
3 | if n.Position = = UDim 2. new( 0 , 28 , 0.0 ) |
4 | then |
5 | n.Position = UDim 2. new( 0 ,- 272 , 0 , 0 ) --The original Position |
6 |
7 | end |
8 |
9 | --If a frame hits a certain position, then it should automatically revert to the original position the frame was set to. |
Yes it will work but you it will looks something like this:
1 | local n = script.Parent |
2 |
3 | n.Position.Changed:connect( function () -- To trigger the function |
4 | if n.Position = = UDim 2. new( 0 , 28 , 0.0 ) then |
5 | n.Position = UDim 2. new( 0 ,- 272 , 0 , 0 ) |
6 | end |
7 | end ) |