generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Attempted to index ?

Previous Thread :: Next Thread 
Waccsadac is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image