|
| 26 Jan 2014 10:09 PM |
I'm a pretty good scripter in terms of pretty much anything roblox, so I'm not a noob. However, I just can't wrap my head around NPCs.
Here's a snippet of my code:
MyAI = game.Lighting.AI:Clone() MyAI.Parent = workspace MyAI:MakeJoints() MyAI.Name = " " local v = (GetSpawn(BrickColor.new("Br. yellowish green")).Position + Vector3.new(0,4,0)) - MyAI.Torso.Position MyAI:TranslateBy(v)
GetSpawn simply finds a spawn. game.Lighting.AI is a perfectly healthy NPC with joints and all that I stored in lighting.
I play the game, and what happened was, well, it lost its arms and legs. It only has its head and torso. It's alive, but not very useful.
What did I do wrong? Is there any way to clone an NPC in lighting and put it in Workspace in one piece? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 10:24 PM |
Update:
I tried changing
MyAI:MakeJoints()
to
MyAI.Head:MakeJoints() MyAI.Torso:MakeJoints()
Still didn't work. :/ Anyone? |
|
|
| Report Abuse |
|
|
ash877
|
  |
| Joined: 18 Feb 2008 |
| Total Posts: 5142 |
|
|
| 26 Jan 2014 10:39 PM |
| put makejoints before you spawn it in? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 10:42 PM |
Tried.
Besides, it wouldn't work. Moving it to workspace is what appears to break it to begin with. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 10:46 PM |
I tried moving the original to workspace and anchoring it:
MyAI = workspace.BaseAI:Clone() MyAI.Parent = workspace MyAI:MakeJoints() MyAI.Name = " " local v = (GetSpawn(BrickColor.new("Br. yellowish green")).Position + Vector3.new(0,4,0)) - MyAI.Torso.Position MyAI:TranslateBy(v) MyAI.Torso.Anchored = false MyAI:MakeJoints()
Still dying. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 10:50 PM |
| You need to add joints. Or weld. When you go 'Test' mode, copy the joints inside your torso and copy paste into 'MyAl' |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 10:54 PM |
| By MyAI, do you mean put the joints into the copy, or the original? |
|
|
| Report Abuse |
|
|
| |
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 26 Jan 2014 10:57 PM |
| Hm..did you try having it anchored, then unanchor it at the end of the script? May not work but it's worth a try. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 11:01 PM |
The original already has joints. /HsYKRBg (imgur)
Now get this.
I tried reverting the code to one of my earlier attempts:
MyAI = game.Lighting.AI:Clone() MyAI.Parent = workspace MyAI:MakeJoints() local v = (GetSpawn(BrickColor.new("Br. yellowish green")).Position + Vector3.new(0,4,0)) - MyAI.Torso.Position MyAI:TranslateBy(v)
It works in test mode and in start server mode, but when I play it, it dies.
Whaaa? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 11:02 PM |
| @Sean - I tried that too, it lived, but died as soon as I unanchored it. Even after I made joints. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 11:09 PM |
And now, after all this, it goes back to living, but without its arms and legs. >_>
WHY ROBLOX? WHY DO YOU DO THIS TO US? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 11:13 PM |
| This is my last bump. If I still can't find help, then I'm just going to find some sort of regen script and make 13 different AIs. D: |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2014 11:47 PM |
I could help you with this, but you have to send me a PM.
|
|
|
| Report Abuse |
|
|
jaredmai
|
  |
| Joined: 08 Sep 2011 |
| Total Posts: 395 |
|
|
| 26 Jan 2014 11:52 PM |
| Have you tried both regular script and local script? This looks like a local script. I've had that happen to me before the local script doesn't work but regular does :/ |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Jan 2014 12:32 AM |
Mk, well, since this apparently is impossible to fix, I'll just make 16 different AIs with regen scripts.
Thanks anyways guys!
Cya! |
|
|
| Report Abuse |
|
|