cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2014 09:54 AM |
After setting PrimaryPart, whenever I index model.PrimaryPart it says it's nil. Yet in play-solo it *somtimes* works...
The script I use it in (yes, I'm possitive objectTarget is not nil, objectTarget.Primary exists, and everything else exists/is defined)
setFakeModel = function(position) fakeModel = objectTarget:Clone(); fakeModel.PrimaryPart = fakeModel.Primary; forEach(fakeModel:GetChildren(), true, function(key, value) if value:IsA("BasePart") then value.Transparency = value.Name:sub(-2) == "PH" and 0.75 or 0.5; value.Anchored = true; value.CanCollide = false; value.Locked = true; elseif not (value:IsA("Model") or value:IsA("DataModelMesh") or value:IsA("FaceInstance")) then value:Destroy(); end end); fakeModel.Parent = workspace; fakeModel:MakeJoints(); fakeModel:MoveTo(position); end;
Do I have to parent it then set primarypart? I tried that and still sometimes get that error. |
|
|
| Report Abuse |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2014 09:57 AM |
Actually, it seems to always work in play solo. And the other tool that has this same function seems to always work online. |
|
|
| Report Abuse |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2014 10:03 AM |
Also, side note: After setting PrimaryPart, instead of indexing Model.PrimaryPart I index Model.Primary (what I used as the PrimaryPart) and it worked fine... |
|
|
| Report Abuse |
|