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: Auto Regen

Previous Thread :: Next Thread 
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
21 Apr 2014 01:32 PM
I have a humanoid target that after it dies, I want it to regen. How would that work?
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
21 Apr 2014 01:34 PM
Anyone?
Report Abuse
URX is not online. URX
Joined: 10 Nov 2009
Total Posts: 1054
21 Apr 2014 01:35 PM
name="Humanoid"
robo=script.Parent:clone() -- put script in humanoid so the model is the parent of the script
while true do
wait(10)
if script.Parent.Human.Health<1 then
robot=robo:clone()
robot.Parent=script.Parent.Parent
robot:makeJoints()
script.Parent:remove()
end
end
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
21 Apr 2014 01:36 PM
Thank you very much!
Report Abuse
URX is not online. URX
Joined: 10 Nov 2009
Total Posts: 1054
21 Apr 2014 01:38 PM
Sorry, change it to

name="Humanoid"
robo=script.Parent:clone() -- put script in humanoid so the model is the parent of the script
while true do
wait(10)
if script.Parent.Humanoid.Health<1 then
robot=robo:clone()
robot.Parent=script.Parent.Parent
robot:makeJoints()
script.Parent:remove()
end
end
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
21 Apr 2014 01:40 PM
All the script does it remove joints and the target falls apart lol
Report Abuse
URX is not online. URX
Joined: 10 Nov 2009
Total Posts: 1054
21 Apr 2014 01:42 PM
the wait(10) is re spawn time? If that's what you were referring to.
Report Abuse
ShadowAley is not online. ShadowAley
Joined: 23 Jun 2010
Total Posts: 4823
21 Apr 2014 01:46 PM
Never mind. I forgot to anchor.. xD
Report Abuse
Mlatu is not online. Mlatu
Joined: 01 Aug 2011
Total Posts: 540
21 Apr 2014 01:51 PM
--put this script in the humanoid~~



local saved_clone = script.Parent.Parent:Clone()
saved_clone.Parent = game.ServerStorage
script.Parent.Died:connect(function()
saved_clone.Parent = script.Parent.Parent.Parent
saved_clone:MakeJoints()
script.Parent.Parent:Destroy()
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