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: Respawn script for NPC

Previous Thread :: Next Thread 
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
23 Apr 2014 06:58 PM
I need to make a respawn script for my NPC's, but nothing is working. This is the one that I have.

resp = script.Parent:clone()

script.Parent.Humanoid.Died:connect(function()
wait(math.random(5,50)
clone = resp:clone()
clone.Parent = script.Parent.Parent
clone:makeJoints()
script.Parent:remove()

end)
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
23 Apr 2014 06:59 PM
*wait(math.random(5,50))
Report Abuse
magoo8 is not online. magoo8
Joined: 25 Apr 2009
Total Posts: 1122
23 Apr 2014 07:03 PM
Free models :D
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
23 Apr 2014 07:05 PM
Halp or gtfo
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
23 Apr 2014 07:06 PM
Damn it, imma be banned now. forget this
Report Abuse
magoo8 is not online. magoo8
Joined: 25 Apr 2009
Total Posts: 1122
23 Apr 2014 07:21 PM
Nah you wont be banned, i wont report. >:D

Gimmy all yo robux!
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
23 Apr 2014 07:41 PM
._.
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
26 Apr 2014 10:31 AM
bump
Report Abuse
Kasumo is not online. Kasumo
Joined: 22 Mar 2013
Total Posts: 2467
01 May 2014 07:17 PM
*cough* Bump, maybe. ._.
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
01 May 2014 07:32 PM
script.Parent.Humanoid.Died:connect(function(res)
local modl = game.ServerStorage.ModelNPC -- location
local time = math.random(5,50)
if script.Parent.Humanoid.Health == 0 then -- check incase of malfunction
wait(time)
vr = modl:Clone()
vr.Parent = game.Workspace
vr:MakeJoints()
vr:MoveTo(script.Parent.Head.Position) -- change location or it will spawn where the last NPC died.

script.Parent:Destroy()
end
end)
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