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
 

Re: Copying NPCs

Previous Thread :: Next Thread 
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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 is not online. ash877
Joined: 18 Feb 2008
Total Posts: 5142
26 Jan 2014 10:39 PM
put makejoints before you spawn it in?
Report Abuse
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
ForeverScripter is not online. ForeverScripter
Joined: 14 Jan 2014
Total Posts: 56
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
26 Jan 2014 10:54 PM
By MyAI, do you mean put the joints into the copy, or the original?
Report Abuse
ForeverScripter is not online. ForeverScripter
Joined: 14 Jan 2014
Total Posts: 56
26 Jan 2014 10:57 PM
Original
Report Abuse
seanb117 is not online. 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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
brandonnstar is not online. brandonnstar
Joined: 06 Aug 2008
Total Posts: 56
26 Jan 2014 11:47 PM
I could help you with this, but you have to send me a PM.
Report Abuse
jaredmai is not online. 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
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
27 Jan 2014 12:00 AM
Yes, it is regular.
Report Abuse
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
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
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