Waccsadac
|
  |
| Joined: 02 Jun 2012 |
| Total Posts: 2440 |
|
|
| 28 Nov 2015 06:52 AM |
ItemHandler:6: attempt to index field '?' (a nil value)
page=script.Parent.Parent.Parent.Page shop=script.Parent:GetChildren() items=game.ServerStorage.ShopItems.Vehicles:GetChildren() function update() for i=1, 8 do >line 6 local prop=items[i].Properties if page.Value==1 then shop[i].name.Value=prop.name.Value shop[i].img.Value=prop.img.Value shop[i].price.Value=prop.price.Value end end end script.Parent.Parent.Parent.Page.Changed:connect(update())
Properties is a Folder inside every single thing in items, and in every copy of it there are 3 values called price, img and name. |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 28 Nov 2015 08:47 AM |
| If I remember correctly, Lua returns "?" when a table address with a nil value is indexed. Are you sure that Child number [i] exists in the first place? |
|
|
| Report Abuse |
|
|
Ben1925
|
  |
| Joined: 07 Apr 2011 |
| Total Posts: 741 |
|
|
| 28 Nov 2015 08:50 AM |
| I don't really understand what you're trying to do here, so, give some more context, please. Maybe setting your for statement's end value to #items instead of 8 so that it won't go out of bounds (and so that it won't return nil) will help? |
|
|
| Report Abuse |
|
|