|
| 07 Aug 2015 09:11 PM |
for _, v in pairs(child) do if v.Position > UDim2(0,0,0,1155) then v:Destroy() end end
how would I change the UDim2 so it is in the correct format to compare to v's position? |
|
|
| Report Abuse |
|
|
Voidacity
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15759 |
|
|
| 07 Aug 2015 09:16 PM |
`v` is a gui object right? If that's the case, then you can use AbsolutePosition.
Depends on what you're trying to compare. The X or the Y axis, or both.
if (v.AbsolutePosition.X > 1155) then -- v's X position is more than 1155 end |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 09:25 PM |
| absolute position wont work right with a scrolling frame... :( |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 07 Aug 2015 09:28 PM |
then do
v.Position.X.Offst > 1155 |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 09:32 PM |
| Ahhh thanks. Saved me a lot of trouble. BTW though, its Y, not X. |
|
|
| Report Abuse |
|
|