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 » Game Design
Home Search
 

Re: Respawning Zombie?

Previous Thread :: Next Thread 
james_e3 is not online. james_e3
Joined: 23 Nov 2012
Total Posts: 43
08 May 2017 05:43 PM
How would I code a respawning zombie?
Report Abuse
james_e3 is not online. james_e3
Joined: 23 Nov 2012
Total Posts: 43
08 May 2017 05:45 PM
b
Report Abuse
james_e3 is not online. james_e3
Joined: 23 Nov 2012
Total Posts: 43
08 May 2017 05:54 PM
b2
Report Abuse
james_e3 is not online. james_e3
Joined: 23 Nov 2012
Total Posts: 43
08 May 2017 06:00 PM
b3
Report Abuse
iZug is not online. iZug
Joined: 22 Mar 2012
Total Posts: 2417
08 May 2017 06:12 PM
Place this script into your zombie

local model = script.Parent
local backup = model:clone()

local humanoid = model.Humanoid

function onDied()
wait(5)

backup.Parent = workspace
backup:makeJoints()

model:remove()
end

humanoid.Died:connect(onDied)

function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end

-- declarations

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")

-- regeneration
while true do
local s = wait(1)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
health = health + 0.01 * s * Humanoid.MaxHealth
if health * 1.05 < Humanoid.MaxHealth then
Humanoid.Health = health
else
Humanoid.Health = Humanoid.MaxHealth
end
end
end



אם זה פוגע בך, אל תדבר איתי | ◕‿◕
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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