|
| 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 |
|
|
| |
|
|
| 25 May 2015 11:25 AM |
| I've read through this like twelve times and I can't find any error. :c |
|
|
| Report Abuse |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 25 May 2015 11:32 AM |
| @1080, 'cause people who can script are incapable of realizing and correcting a simply typo themselves. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|