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: Help! Whenever I clone an NPC, it dies immediately!

Previous Thread :: Next Thread 
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:13 PM
Yes, I used MakeJoints(). My NPC has more than 6 bricks. I defined a Torso, Left Leg, and Right Leg. I changed the name of Humanoid to Enemy. And my NPC keeps dying. Any ideas?
Report Abuse
mactrent is not online. mactrent
Joined: 04 Mar 2009
Total Posts: 1239
15 Dec 2009 04:14 PM
Enemy.Health=Enemy.MaxHealth

<~mac
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:15 PM
Tried that. My NPC still goes down like a tree that just had an encounter with a chainsaw wielding lumberjack.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
15 Dec 2009 04:16 PM
Pfft, just make sure the humanoid comes .5 seconds after it is spawned. So make sure there is no humanoid in the NPC then spawn one .5 seconds later. It dies because when the scripts make the joints, the humanoid has already confirmed that they are not there before hand.
Report Abuse
mactrent is not online. mactrent
Joined: 04 Mar 2009
Total Posts: 1239
15 Dec 2009 04:16 PM
Did you define the health BEFORE you put it in workspace?

If you didn't, that would leave a bit of time where its health was 0...

<~mac
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:18 PM
It still dies... >_>
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:22 PM
My NPC breaks apart whether or not the Humanoid is there... So that's the problem, I guess it's unstable?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
15 Dec 2009 04:23 PM
OMG

Listen to what mactrent said.....imbecile...
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:24 PM
I tried it, fool.

It still collapses.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
15 Dec 2009 04:25 PM
Then you are the fool, you don't look hard enough. Before you ignorantly insult me again, try LOOKING
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:26 PM
At 30 lines? I've checked everything. There isn't a single error, output has no help, so... it's a lost cause right now.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
15 Dec 2009 04:29 PM
post the stupid script...
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:31 PM
while true do
wait (0.01)
local dude = game.Workspace:findFirstChild("Necromancer")
if (dude==nil) then
local c = game.Lighting.Necromancer:clone()
c:MakeJoints()
c.Parent = game.Workspace
c.Torso.CFrame = CFrame.new(0, 11.9, 239.5) * CFrame.fromEulerAnglesXYZ(0,math.rad(90),0)
wait (0.5)
local ce = game.Lighting.Enemy:clone()
ce.Health = ce.MaxHealth
ce.Parent = c
elseif (dude.Enemy.Health==0) then
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "The Necromancer has been slain! Good work, brave heros!"
wait (15)
m:remove()
wait (15)
dude:remove()
local cl = game.Lighting.Necromancer:clone()
cl:MakeJoints()
cl.Parent = game.Workspace
cl.Torso.CFrame = CFrame.new(0, 11.9, 239.5) * CFrame.fromEulerAnglesXYZ(0,math.rad(90),0)
wait (0.5)
local cle = game.Lighting.Enemy:clone()
cle.Health = cle.MaxHealth
cle.Parent = cl
local msg = Instance.new("Message")
msg.Text = "The Necromancer has returned! Fend him off until he is no more!"
msg.Parent = game.Workspace
wait (5)
msg:remove()
end
end
Report Abuse
mactrent is not online. mactrent
Joined: 04 Mar 2009
Total Posts: 1239
15 Dec 2009 04:38 PM
Did it at least stay alive long enough to keep together when you CFramed the torso?
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:38 PM
No, you gave me an idea though. CFrame the torso THEN Make Joints. That oughtta work. :P
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:48 PM
Nothing is working D:
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 04:59 PM
Help please.
Report Abuse
Konamii is not online. Konamii
Joined: 02 Feb 2009
Total Posts: 47
15 Dec 2009 05:13 PM
I haven't read your script, but I'll offer a piece of random help. sorry if it doesn't help.

c=person:Clone()
c.Parent=game.Workspace
c:MakeJoints()
c.Torso.CFrame=CFrame.new(x,y,z)

if your humanoid in question already has an animate script, then replace
c:MakeJoints()
with
c.Head:MakeJoints()

For some reason, trying to make joints welds causes an error, at least back long time ago when I scripted. Don't know about now
Report Abuse
Konamii is not online. Konamii
Joined: 02 Feb 2009
Total Posts: 47
15 Dec 2009 05:13 PM
Be sure to put the Makejoints between setting parent, and cframing it
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 05:17 PM
Wow, thanks :o
I'll try that some other time.
Report Abuse
Mixmasta3000 is not online. Mixmasta3000
Joined: 29 Jun 2007
Total Posts: 722
15 Dec 2009 06:04 PM
For some reason. Even if I set the health. The Humanoid still has the health of 0 when it gets into the NPC.
Report Abuse
Kevin7704 is online. Kevin7704
Joined: 08 Jan 2009
Total Posts: 5568
23 Dec 2009 07:42 PM
Pfft, just make sure the humanoid comes .5 seconds after it is spawned. So make sure there is no humanoid in the NPC then spawn one .5 seconds later. It dies because when the scripts make the joints, the humanoid has already confirmed that they are not there before hand.

its the max health
Report Abuse
Kevin7704 is online. Kevin7704
Joined: 08 Jan 2009
Total Posts: 5568
23 Dec 2009 07:43 PM
c=person:Clone()
c.Parent=game.Workspace
c:MakeJoints()
c.Torso.CFrame=CFrame.new(x,y,z)

if your humanoid in question already has an animate script, then replace
c:MakeJoints()
with
c.Head:MakeJoints()

thats why the NPC died
Report Abuse
ProbeIke is not online. ProbeIke
Joined: 22 Apr 2008
Total Posts: 3134
23 Dec 2009 07:43 PM
[ Content Deleted ]
Report Abuse
Arioka is not online. Arioka
Joined: 01 Sep 2008
Total Posts: 5165
23 Dec 2009 07:45 PM
This is a really old thread. I only posted it for refrance. I'm sure they don't need help anymore. Don't you guys check first?
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