Advertisement
PresidentIvan

Roblox Zombie Spawner

Feb 3rd, 2019
7,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function dmg(hit)
  2.     local h = hit.Parent:FindFirstChild("Humanoid")
  3.     if h ~= nil then
  4.         h.Health = h.Health - 1
  5.     end
  6. end
  7. function infect(hit)
  8.     local h = hit.Parent:FindFirstChild("Humanoid")
  9.     if h ~= nil and hit.Parent ~= script.Parent then
  10.         local infection = script:Clone()
  11.         infection.Parent = hit.Parent
  12.     end
  13. end
  14. script.Parent.UpperTorso.Touched:connect(infect)
  15. script.Parent.LowerTorso.Touched:connect(infect)
  16. script.Parent["RightUpperArm"].Touched:connect(dmg)
  17. script.Parent["RightLowerArm"].Touched:connect(dmg)
  18. script.Parent["RightHand"].Touched:connect(dmg)
  19. script.Parent["LeftUpperArm"].Touched:connect(dmg)
  20. script.Parent["LeftLowerArm"].Touched:connect(dmg)
  21. script.Parent["LeftHand"].Touched:connect(dmg)
  22. script.Parent["RightUpperLeg"].Touched:connect(dmg)
  23. script.Parent["RightLowerLeg"].Touched:connect(dmg)
  24. script.Parent["RightFoot"].Touched:connect(dmg)
  25. script.Parent["LeftUpperLeg"].Touched:connect(dmg)
  26. script.Parent["LeftLowerLeg"].Touched:connect(dmg)
  27. script.Parent["LeftFoot"].Touched:connect(dmg)
  28. while true do
  29.     wait(.1)
  30.     script.Parent["RightUpperArm"].BrickColor = BrickColor.new("Forest green")  
  31.     script.Parent["RightLowerArm"].BrickColor = BrickColor.new("Forest green")
  32.     script.Parent["RightHand"].BrickColor = BrickColor.new("Forest green")
  33.     script.Parent["LeftUpperArm"].BrickColor = BrickColor.new("Forest green")
  34.     script.Parent["LeftLowerArm"].BrickColor = BrickColor.new("Forest green")
  35.     script.Parent["LeftHand"].BrickColor = BrickColor.new("Forest green")
  36.     script.Parent["RightUpperLeg"].BrickColor = BrickColor.new("Dirt brown")
  37.     script.Parent["RightLowerLeg"].BrickColor = BrickColor.new("Dirt brown")
  38.     script.Parent["RightFoot"].BrickColor = BrickColor.new("Dirt brown")
  39.     script.Parent["LeftUpperLeg"].BrickColor = BrickColor.new("Dirt brown")
  40.     script.Parent["LeftLowerLeg"].BrickColor = BrickColor.new("Dirt brown")
  41.     script.Parent["LeftFoot"].BrickColor = BrickColor.new("Dirt brown")
  42.     script.Parent["UpperTorso"].BrickColor = BrickColor.new("Dirt brown")
  43.     script.Parent["LowerTorso"].BrickColor = BrickColor.new("Dirt brown")
  44.     script.Parent.Humanoid.MaxHealth = 75
  45.     script.Parent.Humanoid.WalkSpeed = 16
  46.     script.Parent.Animate.walk.WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=956920334"
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement