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
 

Re: Nil value from a table?

Previous Thread :: Next Thread 
bluefrog53 is not online. bluefrog53
Joined: 05 Feb 2012
Total Posts: 766
25 May 2015 11:12 AM
Well my problem is that the output is saying that "NewSeg" which is a segment for a map generator is a nil value. Here's the script.

Map1Layer1 = {w.M1S1}
Map1Data = {Map1Layer1}
Maps = {Map1Data}
NewMap = math.random(1, #Maps)
ChosenMap = Maps[NewMap]
for i,v in pairs(Layer1)do
Parts = ChosenMap[1]
NewSegNum = math.random(1, #Parts)
NegSeg = Parts[NewSegNum]:Clone()
NewSeg.PrimaryPart = NewSeg.Ppart
NewSeg:SetPrimaryPartCFrame(v.CFrame)
end
Report Abuse
bluefrog53 is not online. bluefrog53
Joined: 05 Feb 2012
Total Posts: 766
25 May 2015 11:20 AM
Bump
Report Abuse
bluefrog53 is not online. bluefrog53
Joined: 05 Feb 2012
Total Posts: 766
25 May 2015 11:25 AM
I've read through this like twelve times and I can't find any error. :c
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
25 May 2015 11:26 AM
'NegSeg'
.-.
Report Abuse
bluefrog53 is not online. bluefrog53
Joined: 05 Feb 2012
Total Posts: 766
25 May 2015 11:28 AM
I will never get that hour of my life back xD. Thank you for pointing that out.
Report Abuse
1080pHD is not online. 1080pHD
Joined: 10 May 2012
Total Posts: 1192
25 May 2015 11:30 AM
What lampwnage said.
you did a typo and put in NegSeg...

Map1Layer1 = {w.M1S1}
Map1Data = {Map1Layer1}
Maps = {Map1Data}
NewMap = math.random(1, #Maps)
ChosenMap = Maps[NewMap]
for i,v in pairs(Layer1)do
Parts = ChosenMap[1]
NewSegNum = math.random(1, #Parts)
NewSeg = Parts[NewSegNum]:Clone()
NewSeg.PrimaryPart = NewSeg.Ppart
NewSeg:SetPrimaryPartCFrame(v.CFrame)
end
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
25 May 2015 11:32 AM
@1080, 'cause people who can script are incapable of realizing and correcting a simply typo themselves.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
25 May 2015 11:51 AM
one time i spent an hour of my life wondering why i was getting a nil value then i realized i made something un-archivable by accident
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