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
 

PrimaryPart problems?

Previous Thread :: Next Thread 
cntkillme is not online. 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 is not online. 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 is not online. 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
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