Advertisement
KarmaRange

Untitled

Jul 15th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1.  
  2. local e = script.Parent:FindFirstChild("Body Colors")
  3. if e then
  4. e:Destroy()
  5. end
  6.  
  7. script.Name = "Zombie"
  8.  
  9. local animation_attack = Instance.new("Animation")
  10. animation_attack.AnimationId = "http://www.roblox.com/asset/?id=362957401"
  11. local running_animation_attack = nil
  12.  
  13. Player = game:GetService("Players").LocalPlayer
  14. PlayerGui = Player.PlayerGui
  15. Cam = workspace.CurrentCamera
  16. Backpack = Player.Backpack
  17. Character = Player.Character
  18. Humanoid = Character.Humanoid
  19. Mouse = Player:GetMouse()
  20. RootPart = Character["HumanoidRootPart"]
  21. Torso = Character["Torso"]
  22. Head = Character["Head"]
  23. RightArm = Character["Right Arm"]
  24. LeftArm = Character["Left Arm"]
  25. RightLeg = Character["Right Leg"]
  26. LeftLeg = Character["Left Leg"]
  27. RootJoint = RootPart["RootJoint"]
  28. Neck = Torso["Neck"]
  29. RightShoulder = Torso["Right Shoulder"]
  30. LeftShoulder = Torso["Left Shoulder"]
  31. RightHip = Torso["Right Hip"]
  32. LeftHip = Torso["Left Hip"]
  33. Head.BrickColor = BrickColor.new("Slime green")
  34. RightArm.BrickColor = BrickColor.new("Slime green")
  35. LeftArm.BrickColor = BrickColor.new("Slime green")
  36. LeftLeg.BrickColor = BrickColor.new("Slime green")
  37. RightLeg.BrickColor = BrickColor.new("Slime green")
  38. Torso.BrickColor = BrickColor.new("Slime green")
  39. wait(1)
  40. Head.BrickColor = BrickColor.new("Slime green")
  41. RightArm.BrickColor = BrickColor.new("Slime green")
  42. LeftArm.BrickColor = BrickColor.new("Slime green")
  43. LeftLeg.BrickColor = BrickColor.new("Slime green")
  44. RightLeg.BrickColor = BrickColor.new("Slime green")
  45. Torso.BrickColor = BrickColor.new("Slime green")
  46. Humanoid.MaxHealth = "inf"
  47. Humanoid.Health = "inf"
  48.  
  49. local BITE = {"131138828","131138835","131138832"}
  50.  
  51. function CreateSound(ID, PARENT, VOLUME, PITCH)
  52. coroutine.resume(coroutine.create(function()
  53. local NEWSOUND = Instance.new("Sound", PARENT)
  54. NEWSOUND.Volume = VOLUME
  55. NEWSOUND.Pitch = PITCH
  56. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  57. NEWSOUND:play()
  58. game:GetService("Debris"):AddItem(NEWSOUND, 10)
  59. end))
  60. end
  61.  
  62. MRANDOM = math.random
  63. attack = false
  64. function onTouch(part)
  65. local humanoid = part.Parent:FindFirstChild("Humanoid")
  66. if (humanoid ~= nil) and attack == false and part.Parent:FindFirstChild("Zombie") == nil then
  67. attack = true
  68. game:GetService("ContentProvider"):Preload(animation_attack.AnimationId)
  69. if(running_animation_attack == nil) then
  70. local event_keyframe_reached
  71. running_animation_attack = Humanoid:LoadAnimation(animation_attack)
  72. running_animation_attack:Play()
  73. humanoid.MaxHealth = 100
  74. if humanoid.Health > 100 then
  75. humanoid.Health = 100
  76. end
  77. CreateSound(BITE[MRANDOM(1, #BITE)], Head, 4, MRANDOM(8, 12) / 10)
  78. CreateSound("201858024", part, 2, math.random(8, 12) / 10)
  79. humanoid.Health = humanoid.Health - 10
  80. if humanoid.Health < 30 then
  81. humanoid.MaxHealth = "inf"
  82. humanoid.Health = "inf"
  83. local infect = script:Clone()
  84. infect.Parent = humanoid.Parent
  85. end
  86. wait(1)
  87. running_animation_attack:Stop()
  88. running_animation_attack = nil
  89. attack = false
  90. end
  91. end
  92. end
  93.  
  94. Torso.Touched:connect(onTouch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement