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 » Scripting Helpers
Home Search
 

Re: Why is this showing a nil value when it's there?

Previous Thread :: Next Thread 
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 05:33 PM
Main - A gui frame with text labels: Armor, Attack, Size, Speed and a Button
Vehicles - A configuration folder with values inside

for i,v in ipairs(Main.Armor:GetChildren()) do
if v.Num.Value >= Vehicles[i].Armor.Value then
v.BackgroundColor3 = Color3.new(255/255, 85/255, 0/255)
end
end

Why is it saying attempt to index field '?' (a nil value)
Report Abuse
KanataIzumi7 is not online. KanataIzumi7
Joined: 08 May 2011
Total Posts: 949
08 May 2013 05:36 PM
Did you label what each variable means?
Report Abuse
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 05:39 PM
Yes
Report Abuse
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 05:40 PM
I think the problem is, the Vehicles[i] part runs through the top values for some reason, and there's only 3 of them while there are 10 gui parts to be changed. I only want to compare all 10 values of the guis to a SINGLE value in the Vehicles[i] part
Report Abuse
scrat101 is not online. scrat101
Joined: 26 Jan 2009
Total Posts: 331
08 May 2013 05:45 PM
Do you mean that you only want to compare those gui values to a single value at a time?
Report Abuse
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 05:47 PM
Yes, it's a stat bar, and it's set by a value in the config folder (So if the value is 5, then 5 of 10 squares will light up) but its coming up as nil.. it's to do with the Vehicles[i] part
Report Abuse
scrat101 is not online. scrat101
Joined: 26 Jan 2009
Total Posts: 331
08 May 2013 05:56 PM
I am getting that you want your index variable for your Vehicle table to remain static. If that is the case, your problem may be that you are using your i counter to index your Vehicle table. The i variable keeps getting bigger and bigger until it overflows the table.
Report Abuse
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 05:59 PM
How would I fix this? The values for the vehicles make a gui button, which when pressed is what triggers this function to happen
Report Abuse
scrat101 is not online. scrat101
Joined: 26 Jan 2009
Total Posts: 331
08 May 2013 06:03 PM
Do you have this inner loop you just showed us being inside a larger loop?
Report Abuse
KillerKyle is not online. KillerKyle
Joined: 29 Jul 2007
Total Posts: 6371
08 May 2013 06:05 PM
Can we have the entire script please? Variables and all. We can't help you without everything.
Report Abuse
Colonized is not online. Colonized
Joined: 23 Jul 2011
Total Posts: 160
08 May 2013 06:07 PM
Sure, here's the Hierarchy: puu.sh/2PzT5/19143cd142.png

I'll PM the script

Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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