luskanek Posted May 5, 2017 Share Posted May 5, 2017 (edited) Nevermind fixed it Edited May 5, 2017 by luskanek Link to comment
luskanek Posted May 6, 2017 Author Share Posted May 6, 2017 *boop* got a new problem with my script for i, colshape in ipairs(getElementsByType("colshape")) do if isElementWithinColShape(player, colshape) then for o, object in ipairs(getElementsByType("object")) do if isElementWithinColShape(object, colshape) then for _, object in ipairs(getElementsByType("object")) do GUIEditor.row[1] = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], GUIEditor.row[1], column, getElementModel(object), false, false) end end end end end Hey guys I got a problem with my function. I have 3 objects within a colshape and I want their model IDs to be added to a gridlist GUI. The problem is, there are 3 objects, but about 15 rows get added to the gridlist with duplicated IDs. The rows should look like this: 1 2 3 But what happens is: 1 2 3 3 3 1 2 3 3 3 and this goes on until it loops 3 times. How do I fix it? Link to comment
pa3ck Posted May 6, 2017 Share Posted May 6, 2017 (edited) I'm not sure if I understand your problem, what is the last loop for? In the first 1 and 2nd loop you have if statements but not in the 3rd? So you basically loop through all the objects again? Edited May 6, 2017 by pa3ck Link to comment
DNL291 Posted May 7, 2017 Share Posted May 7, 2017 (edited) Maybe removing the for-loop at line 5 will fix these multiple rows? Edited May 7, 2017 by DNL291 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now