Advertisement
firebudgy

zombie

Jan 22nd, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.71 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Decal3 = Instance.new("Decal")
  23. Part4 = Instance.new("Part")
  24. Part5 = Instance.new("Part")
  25. Part6 = Instance.new("Part")
  26. Humanoid7 = Instance.new("Humanoid")
  27. Part8 = Instance.new("Part")
  28. Script9 = Instance.new("Script")
  29. Part10 = Instance.new("Part")
  30. Script11 = Instance.new("Script")
  31. ObjectValue12 = Instance.new("ObjectValue")
  32. IntValue13 = Instance.new("IntValue")
  33. Script14 = Instance.new("Script")
  34. Script15 = Instance.new("Script")
  35. Script16 = Instance.new("Script")
  36. Model0.Name = "Zombie"
  37. Model0.Parent = mas
  38. Part1.Name = "Head"
  39. Part1.Parent = Model0
  40. Part1.BrickColor = BrickColor.new("Medium green")
  41. Part1.Rotation = Vector3.new(180, -54.9300003, 180)
  42. Part1.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  43. Part1.Velocity = Vector3.new(0.00206289534, 0.0126342718, -0.0115660513)
  44. Part1.FormFactor = Enum.FormFactor.Symmetric
  45. Part1.Size = Vector3.new(2, 1, 1)
  46. Part1.CFrame = CFrame.new(-48.3656349, 98.0984192, 63.5160103, -0.574513257, -5.27244637e-10, -0.818496227, -4.39582731e-10, 1, -3.35614286e-10, 0.818496227, 1.66981984e-10, -0.574513257)
  47. Part1.TopSurface = Enum.SurfaceType.Smooth
  48. Part1.Color = Color3.new(0.631373, 0.768628, 0.54902)
  49. Part1.Position = Vector3.new(-48.3656349, 98.0984192, 63.5160103)
  50. Part1.Orientation = Vector3.new(0, -125.07, 0)
  51. Part1.Color = Color3.new(0.631373, 0.768628, 0.54902)
  52. SpecialMesh2.Parent = Part1
  53. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  54. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  55. Decal3.Name = "face"
  56. Decal3.Parent = Part1
  57. Part4.Name = "Torso"
  58. Part4.Parent = Model0
  59. Part4.BrickColor = BrickColor.new("Reddish brown")
  60. Part4.Rotation = Vector3.new(180, -54.9300003, 180)
  61. Part4.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  62. Part4.Velocity = Vector3.new(0.00206288393, 0.0126342718, -0.0115660597)
  63. Part4.FormFactor = Enum.FormFactor.Symmetric
  64. Part4.Size = Vector3.new(2, 2, 1)
  65. Part4.CFrame = CFrame.new(-48.3656349, 96.5984192, 63.5160103, -0.574512959, -5.27244526e-10, -0.81849581, -4.39582648e-10, 1, -3.35614148e-10, 0.81849581, 1.66981887e-10, -0.574512959)
  66. Part4.LeftSurface = Enum.SurfaceType.Weld
  67. Part4.RightSurface = Enum.SurfaceType.Weld
  68. Part4.Color = Color3.new(0.411765, 0.25098, 0.156863)
  69. Part4.Position = Vector3.new(-48.3656349, 96.5984192, 63.5160103)
  70. Part4.Orientation = Vector3.new(0, -125.07, 0)
  71. Part4.Color = Color3.new(0.411765, 0.25098, 0.156863)
  72. Part5.Name = "Left Leg"
  73. Part5.Parent = Model0
  74. Part5.BrickColor = BrickColor.new("Reddish brown")
  75. Part5.Rotation = Vector3.new(180, -54.9300003, 180)
  76. Part5.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  77. Part5.Velocity = Vector3.new(0.0123486901, 0.0126342718, -0.00434628408)
  78. Part5.CanCollide = false
  79. Part5.FormFactor = Enum.FormFactor.Symmetric
  80. Part5.Size = Vector3.new(1, 2, 1)
  81. Part5.CFrame = CFrame.new(-48.0783768, 94.5984192, 63.1067619, -0.574513257, -5.27244637e-10, -0.818496227, -4.39582731e-10, 1, -3.35614286e-10, 0.818496227, 1.66981984e-10, -0.574513257)
  82. Part5.BottomSurface = Enum.SurfaceType.Smooth
  83. Part5.Color = Color3.new(0.411765, 0.25098, 0.156863)
  84. Part5.Position = Vector3.new(-48.0783768, 94.5984192, 63.1067619)
  85. Part5.Orientation = Vector3.new(0, -125.07, 0)
  86. Part5.Color = Color3.new(0.411765, 0.25098, 0.156863)
  87. Part6.Name = "Right Leg"
  88. Part6.Parent = Model0
  89. Part6.BrickColor = BrickColor.new("Reddish brown")
  90. Part6.Rotation = Vector3.new(180, -54.9300003, 180)
  91. Part6.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  92. Part6.Velocity = Vector3.new(-0.00822314341, 0.0126342718, -0.0187859535)
  93. Part6.CanCollide = false
  94. Part6.FormFactor = Enum.FormFactor.Symmetric
  95. Part6.Size = Vector3.new(1, 2, 1)
  96. Part6.CFrame = CFrame.new(-48.6528969, 94.5984192, 63.9252663, -0.574513257, -5.27244637e-10, -0.818496227, -4.39582731e-10, 1, -3.35614286e-10, 0.818496227, 1.66981984e-10, -0.574513257)
  97. Part6.BottomSurface = Enum.SurfaceType.Smooth
  98. Part6.Color = Color3.new(0.411765, 0.25098, 0.156863)
  99. Part6.Position = Vector3.new(-48.6528969, 94.5984192, 63.9252663)
  100. Part6.Orientation = Vector3.new(0, -125.07, 0)
  101. Part6.Color = Color3.new(0.411765, 0.25098, 0.156863)
  102. Humanoid7.Parent = Model0
  103. Humanoid7.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  104. Humanoid7.RightLeg = Part6
  105. Humanoid7.LeftLeg = Part5
  106. Humanoid7.Torso = Part4
  107. Part8.Name = "zarm"
  108. Part8.Parent = Model0
  109. Part8.BrickColor = BrickColor.new("Medium green")
  110. Part8.Rotation = Vector3.new(0, -35.0699997, 0)
  111. Part8.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  112. Part8.Velocity = Vector3.new(0.0257006586, 0.0126342671, 0.0203792211)
  113. Part8.FormFactor = Enum.FormFactor.Symmetric
  114. Part8.Size = Vector3.new(2, 1, 1)
  115. Part8.CFrame = CFrame.new(-47.0946083, 97.0984192, 62.5755196, 0.818496227, -5.27244637e-10, -0.574513257, 3.35614286e-10, 1, -4.39582731e-10, 0.574513257, 1.66981984e-10, 0.818496227)
  116. Part8.BottomSurface = Enum.SurfaceType.Smooth
  117. Part8.TopSurface = Enum.SurfaceType.Smooth
  118. Part8.Color = Color3.new(0.631373, 0.768628, 0.54902)
  119. Part8.Position = Vector3.new(-47.0946083, 97.0984192, 62.5755196)
  120. Part8.Orientation = Vector3.new(0, -35.0699997, 0)
  121. Part8.Color = Color3.new(0.631373, 0.768628, 0.54902)
  122. Script9.Parent = Part8
  123. table.insert(cors,sandbox(Script9,function()
  124. wait(1)
  125. owner=script.Parent.Parent.Name
  126.  
  127. function onTouched(part)
  128. if part.Parent ~= nil then
  129. local h = part.Parent:findFirstChild("Humanoid")
  130. if h~=nil then
  131. if cantouch~=0 then
  132. if h.Parent.Name~=owner then
  133.  
  134. if h.Parent:findFirstChild("zarm")~=nil then return end
  135.  
  136. cantouch=0
  137.  
  138. local larm=h.Parent:findFirstChild("Left Arm")
  139. local rarm=h.Parent:findFirstChild("Right Arm")
  140.  
  141. if larm~=nil then
  142. larm:remove()
  143. end
  144. if rarm~=nil then
  145. rarm:remove()
  146. end
  147. local zee=script.Parent.Parent:findFirstChild("zarm")
  148. if zee~=nil then
  149. local zlarm=zee:clone()
  150. local zrarm=zee:clone()
  151. if zlarm~=nil then
  152.  
  153. local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  154. zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
  155. zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
  156. zlarm.Parent=h.Parent
  157. zrarm.Parent=h.Parent
  158. zlarm:makeJoints()
  159. zrarm:makeJoints()
  160. zlarm.Anchored=false
  161. zrarm.Anchored=false
  162. wait(0.1)
  163. h.Parent.Head.Color=zee.Color
  164. else print("no zee"); return end
  165. end
  166. wait(1)
  167. cantouch=1
  168. end
  169. end
  170. end
  171. end
  172. end
  173.  
  174. script.Parent.Touched:connect(onTouched)
  175. end))
  176. Part10.Name = "zarm"
  177. Part10.Parent = Model0
  178. Part10.BrickColor = BrickColor.new("Medium green")
  179. Part10.Rotation = Vector3.new(0, -35.0699997, 0)
  180. Part10.RotVelocity = Vector3.new(5.65646729e-09, -0.025133444, -7.64907426e-09)
  181. Part10.Velocity = Vector3.new(-0.0360143594, 0.0126342671, -0.0229395963)
  182. Part10.FormFactor = Enum.FormFactor.Symmetric
  183. Part10.Size = Vector3.new(2, 1, 1)
  184. Part10.CFrame = CFrame.new(-48.818161, 97.0984192, 65.0310135, 0.818496227, -5.27244637e-10, -0.574513257, 3.35614286e-10, 1, -4.39582731e-10, 0.574513257, 1.66981984e-10, 0.818496227)
  185. Part10.BottomSurface = Enum.SurfaceType.Smooth
  186. Part10.TopSurface = Enum.SurfaceType.Smooth
  187. Part10.Color = Color3.new(0.631373, 0.768628, 0.54902)
  188. Part10.Position = Vector3.new(-48.818161, 97.0984192, 65.0310135)
  189. Part10.Orientation = Vector3.new(0, -35.0699997, 0)
  190. Part10.Color = Color3.new(0.631373, 0.768628, 0.54902)
  191. Script11.Parent = Part10
  192. table.insert(cors,sandbox(Script11,function()
  193. wait(1)
  194. owner=script.Parent.Parent.Name
  195.  
  196. function onTouched(part)
  197. if part.Parent ~= nil then
  198. local h = part.Parent:findFirstChild("Humanoid")
  199. if h~=nil then
  200. if cantouch~=0 then
  201. if h.Parent.Name~=owner then
  202.  
  203. if h.Parent:findFirstChild("zarm")~=nil then return end
  204.  
  205. cantouch=0
  206.  
  207. local larm=h.Parent:findFirstChild("Left Arm")
  208. local rarm=h.Parent:findFirstChild("Right Arm")
  209.  
  210. if larm~=nil then
  211. larm:remove()
  212. end
  213. if rarm~=nil then
  214. rarm:remove()
  215. end
  216. local zee=script.Parent.Parent:findFirstChild("zarm")
  217. if zee~=nil then
  218. local zlarm=zee:clone()
  219. local zrarm=zee:clone()
  220. if zlarm~=nil then
  221.  
  222. local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  223. zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
  224. zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
  225. zlarm.Parent=h.Parent
  226. zrarm.Parent=h.Parent
  227. zlarm:makeJoints()
  228. zrarm:makeJoints()
  229. zlarm.Anchored=false
  230. zrarm.Anchored=false
  231. wait(0.1)
  232. h.Parent.Head.Color=zee.Color
  233. else print("no zee"); return end
  234. end
  235. wait(1)
  236. cantouch=1
  237. end
  238. end
  239. end
  240. end
  241. end
  242.  
  243. script.Parent.Touched:connect(onTouched)
  244. end))
  245. ObjectValue12.Name = "IsNZ"
  246. ObjectValue12.Parent = Model0
  247. IntValue13.Name = "Mode"
  248. IntValue13.Parent = Model0
  249. Script14.Parent = Model0
  250. table.insert(cors,sandbox(Script14,function()
  251. local larm = script.Parent:FindFirstChild("Left Arm")
  252. local rarm = script.Parent:FindFirstChild("Right Arm")
  253.  
  254. function findNearestTorso(pos)
  255. local list = game.Workspace:children()
  256. local torso = nil
  257. local dist = 1000
  258. local temp = nil
  259. local human = nil
  260. local temp2 = nil
  261. for x = 1, #list do
  262. temp2 = list[x]
  263. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  264. temp = temp2:findFirstChild("Right Arm")
  265. human = temp2:findFirstChild("Humanoid")
  266. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  267. if (temp.Position - pos).magnitude < dist then
  268. torso = temp
  269. dist = (temp.Position - pos).magnitude
  270. end
  271. end
  272. end
  273. end
  274. return torso
  275. end
  276.  
  277.  
  278.  
  279.  
  280. while true do
  281. wait(math.random(1,5))
  282. local target = findNearestTorso(script.Parent.Torso.Position)
  283. if target ~= nil then
  284. script.Parent.Humanoid:MoveTo(target.Position, target)
  285. end
  286.  
  287. end
  288.  
  289. end))
  290. Script15.Name = "Health"
  291. Script15.Parent = Model0
  292. table.insert(cors,sandbox(Script15,function()
  293. function waitForChild(parent, childName)
  294. while true do
  295. local child = parent:findFirstChild(childName)
  296. if child then
  297. return child
  298. end
  299. parent.ChildAdded:wait()
  300. end
  301. end
  302.  
  303. -- declarations
  304.  
  305. local Figure = script.Parent
  306. local Head = waitForChild(Figure, "Head")
  307. local Humanoid = waitForChild(Figure, "Humanoid")
  308. Humanoid.Health=500
  309. -- regeneration
  310. while true do
  311. local s = wait(4)
  312. local health = Humanoid.Health
  313. if health > 0 and health < Humanoid.MaxHealth then
  314. health = health + 0.08 * s * Humanoid.MaxHealth
  315. if health * 1.05 < Humanoid.MaxHealth then
  316. Humanoid.Health = health
  317. else
  318. Humanoid.Health = Humanoid.MaxHealth
  319. end
  320. end
  321. end
  322.  
  323. end))
  324. Script16.Name = "Respawn"
  325. Script16.Parent = Model0
  326. table.insert(cors,sandbox(Script16,function()
  327. name="Humanoid"
  328.  
  329. robo=script.Parent:clone()
  330.  
  331. while true do
  332. wait(1)
  333. if script.Parent.Humanoid.Health<1 then
  334. robot=robo:clone()
  335. robot.Parent=script.Parent.Parent
  336. robot:makeJoints()
  337. script.Parent:remove()
  338. end
  339. end
  340.  
  341.  
  342.  
  343.  
  344. end))
  345. for i,v in pairs(mas:GetChildren()) do
  346. v.Parent = workspace
  347. pcall(function() v:MakeJoints() end)
  348. end
  349. mas:Destroy()
  350. for i,v in pairs(cors) do
  351. spawn(function()
  352. pcall(v)
  353. end)
  354. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement