|
| 14 Jul 2017 09:59 PM |
So, before I go on just take a look at the script I am having trouble with itemsbought = {} for i,v in pairs(script.Parent.Parent.Boxes:GetChildren()) do print (v.Name) print (v.Value) local id = v:FindFirstChildOfClass("IntValue") print(id.Value) table.insert(itemsbought, id.Value, v.Value) end print(itemsbought[1]) print(itemsbought[2]) -- this goes on 4 more times and there is more script above and below, but this should do Essentially, every single time, itemsbought[2] is nil, but in the loop id.Value is not nil, v.Value isn't nil before and after the loop and there is no other id values with a value of 2, every other value is printing fine. Any ideas on what is wrong?
|
|
|
| Report Abuse |
|
|
|
| 14 Jul 2017 10:07 PM |
bump (printing a whole ton of different possibilities trying to find something that would make that nil)
|
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 14 Jul 2017 10:09 PM |
Wait what?
table.insert has only 3 parameters? |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2017 10:10 PM |
It may have more, but they aren't required in this instance
|
|
|
| Report Abuse |
|
|
|
| 14 Jul 2017 10:11 PM |
Just checked wiki, only three. the table, the order and the value
|
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
| |
|
|
| 14 Jul 2017 10:14 PM |
Going to put them all in one at a time without the loop, going to see if that helps
|
|
|
| Report Abuse |
|
|
|
| 14 Jul 2017 10:21 PM |
Okay, I did it without the loop and it works fine, I think it's because the value was being shifted to the beginning of the table leading to at least one value being replaced.
|
|
|
| Report Abuse |
|
|