Advertisement
Upscalefanatic3

Zombies

Oct 3rd, 2016
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.44 KB | None | 0 0
  1. script.Name = "Zombie2"
  2.  
  3. Playing = false
  4. Level = 1
  5. Message = Instance.new("Hint", Workspace)
  6. SoundIDs = {25954372, 25954392, 25954407, 24902268, 24902294}
  7. Outfits = {
  8. --[[
  9. Outfits help:
  10. Outfits follow this sequence: KEY 1: VALUE 1|VALUE 2,KEY 2: VALUE 1|VALUE 2|VALUE 3,KEY 3: VALUE 1,etcetera
  11. Keys: hc, tc, lac, rac, llc, rlc, tshirt, shirt, pants, cmh, cmt, cmla, cmra, cmll, cmrl, hat. See sample below. Note that the keys in the sample are not all required.
  12. Limb colors default to "Really red".
  13. An outfit is ONE STRING. The sample string below is separated in this fashion: "String! " .. "Still the same string!" .. " Hello world!"
  14. Hat sequence: "MeshId|TextureId|Offset.x|.y|.z|Scale.x|.y|.z|VertexColor.x|.y|.z|AttachmentForward.x|.y|.z|AttachmentPos.x|.y|.z|AttachmentRight.x|.y|.z|AttachmentUp.x|.y|.z|Handle.Shape|Handle.FormFactor|Handle.Size.x|.y|.z|Hat.Name"
  15. CharacterMesh (cm) sequence: "BodyPart|MeshId|BaseTextureId|OverlayTextureId"
  16. --]]
  17. "face: rbxasset://textures/face.png,"..
  18. "hc: Br. yellowish green,"..
  19. "tc: Reddish brown,"..
  20. "lac: Br. yellowish green,"..
  21. "rac: Br. yellowish green,"..
  22. "llc: Reddish brown,"..
  23. "rlc: Reddish brown,",
  24.  
  25. "face: rbxasset://textures/face.png,"..
  26. "hc: Br. yellowish green,"..
  27. "tc: Reddish brown,"..
  28. "lac: Br. yellowish green,"..
  29. "rac: Br. yellowish green,"..
  30. "llc: Reddish brown,"..
  31. "rlc: Reddish brown,"..
  32. "shirt: http://www.roblox.com/Asset/?id=23913892,"..
  33. "pants: http://www.roblox.com/Asset/?id=23913910,"..
  34. "cm: Torso|27111894|0|0,"..
  35. "cm: LeftArm|27111419|0|0,"..
  36. "cm: RightArm|27111864|0|0,"..
  37. "cm: LeftLeg|27111857|0|0,"..
  38. "cm: RightLeg|27111882|0|0,"..
  39. "hat: http://www.roblox.com/Asset/?id=18010890|".. --Mesh.MeshId
  40. "http://www.roblox.com/Asset/?id=18010881|".. --Mesh.TextureId
  41. "0|0|0|".. --Mesh.Offset
  42. "1|1|1|".. --Mesh.Scale
  43. "1|1|1|".. --Mesh.VertexColor
  44. "0|0|1|".. --Hat.AttachmentForward
  45. "0|-0.11|0|".. --Hat.AttachmentPos
  46. "1|0|0|".. --Hat.AttachmentRight
  47. "0|1|0|".. --Hat.AttachmentUp
  48. "Block|".. --Handle.Shape
  49. "Symmetric|".. --Handle.FormFactor
  50. "2|1|1|".. --Handle.Size
  51. "U.S. Military Helmet", --Hat.Name
  52.  
  53. "face: rbxasset://textures/face.png,"..
  54. "hc: Br. yellowish green,"..
  55. "tc: Institutional white,"..
  56. "lac: Really black,"..
  57. "rac: Really black,"..
  58. "llc: Really black,"..
  59. "rlc: Really black,"..
  60. "tshirt: http://www.roblox.com/Asset/?id=1718547,"..
  61. "hat: http://www.roblox.com/Asset/?id=22944290|".. --Mesh.MeshId
  62. "http://www.roblox.com/Asset/?id=22944281|".. --Mesh.TextureId
  63. "0|0|0|".. --Mesh.Offset
  64. "1|1|0.97|".. --Mesh.Scale
  65. "1|1|1|".. --Mesh.VertexColor
  66. "0|0|1|".. --Hat.AttachmentForward
  67. "0|-0.15|0.29|"..--Hat.AttachmentPos
  68. "1|0|0|".. --Hat.AttachmentRight
  69. "0|1|0|".. --Hat.AttachmentUp
  70. "Block|".. --Handle.Shape
  71. "Symmetric|".. --Handle.FormFactor
  72. "1|1|2|".. --Handle.Size
  73. "Lua Cap" --Hat.Name
  74. }
  75. RandomNames = {
  76. Prefix = {"the", "my", "his", "hers", "not", "evil", "good", "totally", "master", "mega", "queen", "king", "solar", "super", "so", "incredible", "lost", "crazy", "insane", "iAm", "iam", "really", "alien", "ro", "blox", "DX", "XD", "lol", "rofl", "rlly", "raging", "raeging", "manly", "womanly", "xX", "xXxX", "xXxXxX"},
  77. Center = {"twister", "striker", "epic", "smasher", "cool", "sk8ter", "sk8er", "sk8r", "pwn", "pwnage", "own", "ownage", "owned", "troll", "troller", "lurve", "l0v", "lov", "l0ve", "baby", "tagger", "tagged", "ro", "blox", "king", "queen", "master", "3p1c", "l33t", "leet", "1337", "gai", "john", "peter", "doe", "jimmy", "jacob", "sora", "elliot", "mary", "rager", "raeger", "sara", "sarah", "dawg", "dog", "killer", "slicer", "cutter", "maimer", "attacker", "murderer", "assault", "assaulter", "killa", "k1lla", "k1ll4", "k1ll3r", "ownyou", "OwnYou", "SPAMSPAMSPAMSPAM", "SPAMSPAMSPAM", "THISISNOTASPAMACCOUNT", "who", "paste", "sonic"},
  78. Suffix = {"dude", "daddy", "man", "male", "guy", "gai", "dood", "d00d", "D00D", "gal", "girl", "grl", "lady", "woman", "soul", "dog", "dawg"}
  79. }
  80.  
  81.  
  82. function _G.GenerateRandomUsername()
  83. NamePrefix = math.random(1, 10) == 1 and tostring(math.random(10, 100)) or RandomNames["Prefix"][math.random(1, #RandomNames["Prefix"])]
  84. NameCenter = math.random(1, 50) == 1 and tostring(math.random(10, 100000)) or RandomNames["Center"][math.random(1, #RandomNames["Center"])]
  85. NameSuffix = math.random(1, 10) == 1 and tostring(math.random(10, 1000)) or RandomNames["Suffix"][math.random(1, #RandomNames["Suffix"])]
  86. NamePrefix = math.random(1, 2) == 1 and string.sub(NamePrefix, 0, 1):upper() .. string.sub(NamePrefix, 2) or NamePrefix
  87. NameCenter = math.random(1, 2) == 1 and string.sub(NameCenter, 0, 1):upper() .. string.sub(NameCenter, 2) or NameCenter
  88. NameSuffix = math.random(1, 2) == 1 and string.sub(NameSuffix, 0, 1):upper() .. string.sub(NameSuffix, 2) or NameSuffix
  89. NamePrefix = math.random(1, 10) == 1 and NamePrefix:upper() or NamePrefix
  90. NameCenter = math.random(1, 5) == 1 and NameCenter:upper() or NameCenter
  91. NameSuffix = math.random(1, 10) == 1 and NameSuffix:upper() or NameSuffix
  92. NamePrefix = math.random(1, 10) == 1 and "" or NamePrefix
  93. NameCenter = math.random(1, 100) == 1 and "" or NameCenter
  94. NameSuffix = math.random(1, 10) == 1 and "" or NameSuffix
  95. return NamePrefix .. NameCenter .. NameSuffix
  96. end
  97.  
  98.  
  99. function Explode(Divider, Text)
  100. if Text == "" or type(Text) ~= "string" then return {""} end
  101. if Divider == "" or type(Divider) ~= "string" then return {Text} end
  102. local Position, Words = 0, {}
  103. for Start, Stop in function() return string.find(Text, Divider, Position, true) end do
  104. table.insert(Words, string.sub(Text, Position, Start - 1))
  105. Position = Stop + 1
  106. end
  107. table.insert(Words, string.sub(Text, Position))
  108. return Words
  109. end
  110.  
  111.  
  112. function _G.MakeZombie(Position)
  113. local Character = Instance.new("Model")
  114. Character.Name = _G.GenerateRandomUsername()
  115. Instance.new("Configuration", Character).Name = "Zombie"
  116. local Template = Instance.new("Part")
  117. Template.FormFactor = "Custom"
  118. Template.Size = Vector3.new(1, 2, 1)
  119. Template.BrickColor = BrickColor.new("Really red")
  120. Template.Locked = true
  121. local Head = Template:Clone()
  122. Head.Name = "Head"
  123. Head.TopSurface = "Smooth"
  124. Head.BottomSurface = "Smooth"
  125. Head.Size = Vector3.new(2, 1, 1)
  126. Head.Parent = Character
  127. local Mesh = Instance.new("SpecialMesh")
  128. Mesh.MeshType = "Head"
  129. Mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  130. Mesh.Parent = Head
  131. local Face = Instance.new("Decal")
  132. Face.Name = "face"
  133. Face.Parent = Head
  134. local Torso = Template:Clone()
  135. Torso.Name = "Torso"
  136. Torso.LeftSurface = "Weld"
  137. Torso.RightSurface = "Weld"
  138. Torso.CFrame = CFrame.new(0, 10000, 0)
  139. Torso.Size = Vector3.new(2, 2, 1)
  140. Torso.Parent = Character
  141. local TShirt = Instance.new("Decal")
  142. TShirt.Name = "roblox"
  143. TShirt.Parent = Torso
  144. local LeftArm = Template:Clone()
  145. LeftArm.Name = "Left Arm"
  146. LeftArm.Parent = Character
  147. local RightArm = Template:Clone()
  148. RightArm.Name = "Right Arm"
  149. RightArm.Parent = Character
  150. local LeftLeg = Template:Clone()
  151. LeftLeg.Name = "Left Leg"
  152. LeftLeg.Parent = Character
  153. local RightLeg = Template:Clone()
  154. RightLeg.Name = "Right Leg"
  155. RightLeg.Parent = Character
  156. Character:BreakJoints()
  157. local Neck = Instance.new("Weld")
  158. Neck.Name = "Neck"
  159. Neck.Part0 = Torso
  160. Neck.Part1 = Head
  161. Neck.C0 = CFrame.new(0, 1.5, 0)
  162. Neck.Parent = Torso
  163. local LeftShoulder = Instance.new("Motor")
  164. LeftShoulder.Name = "Left Shoulder"
  165. LeftShoulder.Part0 = Torso
  166. LeftShoulder.Part1 = LeftArm
  167. LeftShoulder.MaxVelocity = 0.1
  168. LeftShoulder.C0 = CFrame.new(-Torso.Size.x / 2 - RightArm.Size.x / 2, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  169. LeftShoulder.C1 = CFrame.new(0, LeftArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  170. LeftShoulder.Parent = Torso
  171. local RightShoulder = Instance.new("Motor")
  172. RightShoulder.Name = "Right Shoulder"
  173. RightShoulder.Part0 = Torso
  174. RightShoulder.Part1 = RightArm
  175. RightShoulder.MaxVelocity = 0.1
  176. RightShoulder.C0 = CFrame.new(Torso.Size.x / 2 + RightArm.Size.x / 2, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  177. RightShoulder.C1 = CFrame.new(0, RightArm.Size.y / 4, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  178. RightShoulder.Parent = Torso
  179. local LeftHip = Instance.new("Motor")
  180. LeftHip.Name = "Left Hip"
  181. LeftHip.Part0 = Torso
  182. LeftHip.Part1 = LeftLeg
  183. LeftHip.MaxVelocity = 0.1
  184. LeftHip.C0 = CFrame.new(-LeftLeg.Size.x / 2, -LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  185. LeftHip.C1 = CFrame.new(0, LeftLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, -3.14 / 2, 0)
  186. LeftHip.Parent = Torso
  187. local RightHip = Instance.new("Motor")
  188. RightHip.Name = "Right Hip"
  189. RightHip.Part0 = Torso
  190. RightHip.Part1 = RightLeg
  191. RightHip.MaxVelocity = 0.1
  192. RightHip.C0 = CFrame.new(RightLeg.Size.x / 2, -RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  193. RightHip.C1 = CFrame.new(0, RightLeg.Size.y / 2, 0) * CFrame.fromEulerAnglesXYZ(0, 3.14 / 2, 0)
  194. RightHip.Parent = Torso
  195. local Humanoid = Instance.new("Humanoid", Character)
  196. Humanoid.WalkSpeed = 10 + math.min(Level * 0.3, 22)
  197. local BodyColors = Instance.new("BodyColors")
  198. BodyColors.LeftArmColor = BrickColor.new("Really red")
  199. BodyColors.RightArmColor = BrickColor.new("Really red")
  200. BodyColors.LeftLegColor = BrickColor.new("Really red")
  201. BodyColors.RightLegColor = BrickColor.new("Really red")
  202. BodyColors.HeadColor = BrickColor.new("Really red")
  203. BodyColors.TorsoColor = BrickColor.new("Really red")
  204. local Outfit = Explode(",", Outfits[math.random(1, #Outfits)])
  205. for x = 1, #Outfit do
  206. if string.sub(Outfit[x], 0, 6) == "face: " then
  207. Face.Texture = string.sub(Outfit[x], 7)
  208. end
  209. if string.sub(Outfit[x], 0, 4) == "hc: " then
  210. Head.BrickColor = BrickColor.new(string.sub(Outfit[x], 5))
  211. BodyColors.HeadColor = BrickColor.new(string.sub(Outfit[x], 5))
  212. end
  213. if string.sub(Outfit[x], 0, 4) == "tc: " then
  214. Torso.BrickColor = BrickColor.new(string.sub(Outfit[x], 5))
  215. BodyColors.TorsoColor = BrickColor.new(string.sub(Outfit[x], 5))
  216. end
  217. if string.sub(Outfit[x], 0, 5) == "lac: " then
  218. LeftArm.BrickColor = BrickColor.new(string.sub(Outfit[x], 6))
  219. BodyColors.LeftArmColor = BrickColor.new(string.sub(Outfit[x], 6))
  220. end
  221. if string.sub(Outfit[x], 0, 5) == "rac: " then
  222. RightArm.BrickColor = BrickColor.new(string.sub(Outfit[x], 6))
  223. BodyColors.RightArmColor = BrickColor.new(string.sub(Outfit[x], 6))
  224. end
  225. if string.sub(Outfit[x], 0, 5) == "llc: " then
  226. LeftLeg.BrickColor = BrickColor.new(string.sub(Outfit[x], 6))
  227. BodyColors.LeftLegColor = BrickColor.new(string.sub(Outfit[x], 6))
  228. end
  229. if string.sub(Outfit[x], 0, 5) == "rlc: " then
  230. RightLeg.BrickColor = BrickColor.new(string.sub(Outfit[x], 6))
  231. BodyColors.RightLegColor = BrickColor.new(string.sub(Outfit[x], 6))
  232. end
  233. if string.sub(Outfit[x], 0, 8) == "tshirt: " then
  234. TShirt.Texture = string.sub(Outfit[x], 9)
  235. end
  236. if string.sub(Outfit[x], 0, 7) == "shirt: " then
  237. local Shirt = Instance.new("Shirt")
  238. Shirt.ShirtTemplate = string.sub(Outfit[x], 8)
  239. Shirt.Parent = Character
  240. end
  241. if string.sub(Outfit[x], 0, 7) == "pants: " then
  242. local Pants = Instance.new("Pants")
  243. Pants.PantsTemplate = string.sub(Outfit[x], 8)
  244. Pants.Parent = Character
  245. end
  246. if string.sub(Outfit[x], 0, 4) == "cm: " then
  247. local Data = Explode("|", string.sub(Outfit[x], 5))
  248. local CM = Instance.new("CharacterMesh")
  249. CM.Name = "Roblox 2.0 " ..Data[1]
  250. CM.BodyPart = Data[1]
  251. CM.MeshId = Data[2]
  252. CM.Parent = Character
  253. end
  254. if string.sub(Outfit[x], 0, 5) == "hat: " then
  255. local Data = Explode("|", string.sub(Outfit[x], 6))
  256. local Mesh = Instance.new("SpecialMesh")
  257. Mesh.MeshType = "FileMesh"
  258. Mesh.MeshId = Data[1]
  259. Mesh.TextureId = Data[2]
  260. Mesh.Offset = Vector3.new(tonumber(Data[3]), tonumber(Data[4]), tonumber(Data[5]))
  261. Mesh.Scale = Vector3.new(tonumber(Data[6]), tonumber(Data[7]), tonumber(Data[8]))
  262. Mesh.VertexColor = Vector3.new(tonumber(Data[9]), tonumber(Data[10]), tonumber(Data[11]))
  263. local Hat = Instance.new("Hat")
  264. Hat.AttachmentForward = Vector3.new(tonumber(Data[12]), tonumber(Data[13]), tonumber(Data[14]))
  265. Hat.AttachmentPos = Vector3.new(tonumber(Data[15]), tonumber(Data[16]), tonumber(Data[17]))
  266. Hat.AttachmentRight = Vector3.new(tonumber(Data[18]), tonumber(Data[19]), tonumber(Data[20]))
  267. Hat.AttachmentUp = Vector3.new(tonumber(Data[21]), tonumber(Data[22]), tonumber(Data[23]))
  268. local Handle = Instance.new("Part")
  269. Handle.Name = "Handle"
  270. Handle.TopSurface = 0
  271. Handle.BottomSurface = 0
  272. Handle.Shape = Data[24]
  273. Handle.FormFactor = Data[25]
  274. Handle.Size = Vector3.new(tonumber(Data[26]), tonumber(Data[27]), tonumber(Data[28]))
  275. Hat.Name = Data[29]
  276. Mesh.Parent = Handle
  277. Handle.Parent = Hat
  278. Hat.Parent = Character
  279. end
  280. end
  281. local SoundObjects = {}
  282. for i = 1, #SoundIDs do
  283. local Sound = Instance.new("Sound")
  284. Sound.SoundId = "http://www.roblox.com/Asset/?id=" .. SoundIDs[i]
  285. Sound.Volume = 1
  286. Sound.Parent = Head
  287. SoundObjects[i] = Sound
  288. end
  289. coroutine.wrap(function()
  290. while true do
  291. wait(math.random(1, 10))
  292. local i = math.random(1, #SoundObjects)
  293. SoundObjects[i].Pitch = math.random(8, 12) / 10
  294. SoundObjects[i]:Play()
  295. end
  296. end)()
  297. BodyColors.Parent = Character
  298. Character.Parent = Workspace
  299. Character:MoveTo(Position)
  300. Character:MoveTo(Torso.Position + Vector3.new(0, 3, 0))
  301. game:GetService("InsertService"):LoadAsset(55821959)["Animate"].Parent = Character
  302. coroutine.wrap(function()
  303. while true do
  304. if Character.Parent == nil or Head.Parent == nil or Torso.Parent == nil or Neck.Parent == nil or Humanoid.Parent == nil or Humanoid.Health <= 0 then wait(5) pcall(function() Character:Remove() end) break end
  305. local List = {}
  306. for _, Model in pairs(Workspace:GetChildren()) do
  307. if Model ~= Character and Model:FindFirstChild("Zombie") == nil and Model:FindFirstChild("ForceField") == nil and Model:FindFirstChild("Torso") ~= nil and Model:FindFirstChild("Humanoid") ~= nil and Model.Humanoid.Health > 0 and Model.Humanoid.MaxHealth > 0 and Model.Humanoid.Health < math.huge and Model.Humanoid.MaxHealth < math.huge then
  308. table.insert(List, Model)
  309. end
  310. end
  311. if #List > 0 then
  312. local Closest = List[1]
  313. for i = 1, #List do
  314. if (Torso.Position - List[i].Torso.Position).magnitude < (Torso.Position - Closest.Torso.Position).magnitude then
  315. Closest = List[i]
  316. end
  317. end
  318. if (Torso.Position - Closest.Torso.Position).magnitude <= 500 then
  319. Humanoid:MoveTo(Closest.Torso.Position + Vector3.new(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)), Closest.Torso)
  320. Torso["Left Shoulder"].DesiredAngle = -math.rad(90)
  321. Torso["Right Shoulder"].DesiredAngle = math.rad(90)
  322. end
  323. if (Torso.Position - Closest.Torso.Position).magnitude <= 4 then
  324. Closest.Humanoid:TakeDamage((math.random(500, 1000) / 1000) * (Level * 0.1))
  325. Torso["Left Shoulder"].DesiredAngle = -math.rad(math.random(0, 180))
  326. Torso["Right Shoulder"].DesiredAngle = math.rad(math.random(0, 180))
  327. end
  328. end
  329. wait()
  330. end
  331. end)()
  332. local function onTouched(Hit)
  333. if Humanoid.Health <= 0 then return end
  334. if Hit.Name ~= "Fire" and Hit.Name ~= "Flame" and Hit.Name ~= "Foam" and Hit.Name ~= "Water" and Hit.CanCollide == true and Hit.Anchored == false and Hit.Parent:FindFirstChild("ForceField") == nil and Hit.Parent.Parent:FindFirstChild("ForceField") == nil and Hit.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent.Parent:FindFirstChild("Humanoid") == nil and Hit.Parent:FindFirstChild("Zombie") == nil and Hit.Parent.Parent:FindFirstChild("Zombie") == nil and math.random(0, math.max(100 / Level, 10)) == 0 then
  335. Hit:BreakJoints()
  336. local Sound = Instance.new("Sound", Torso)
  337. Sound.SoundId = "http://www.roblox.com/Asset/?id=2801263"
  338. Sound.Volume = 0.8
  339. Sound.Pitch = math.random(500, 700) / 1000
  340. Sound:Play()
  341. game:GetService("Debris"):AddItem(Sound, 1)
  342. end
  343. end
  344. LeftArm.Touched:connect(onTouched)
  345. RightArm.Touched:connect(onTouched)
  346. return Character
  347. end
  348.  
  349.  
  350. function NoRespawn(Player)
  351. local function Hook()
  352. if Playing == false then return end
  353. pcall(function()
  354. local Character = Player.Character
  355. Player.Character = nil
  356. Character:Remove()
  357. end)
  358. while Playing == true do wait() end
  359. local Model = Instance.new("Model", Workspace)
  360. local Part = Instance.new("Part", Model)
  361. Part.Name = "Head"
  362. Part.Transparency = 1
  363. Part.CanCollide = false
  364. Part.Anchored = true
  365. Part.Locked = true
  366. Part.Parent = Model
  367. local Humanoid = Instance.new("Humanoid", Model)
  368. Humanoid.Health = 100
  369. Player.Character = Model
  370. Humanoid.Health = 0
  371. end
  372. Hook(Player.Character)
  373. Player.Changed:connect(function(Property)
  374. if Property == "Character" and Player.Character ~= nil and Player.Character:FindFirstChild("Humanoid") ~= nil then
  375. Hook(Player.Character)
  376. end
  377. end)
  378. end
  379. for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
  380. NoRespawn(Player)
  381. end
  382. game:GetService("Players").PlayerAdded:connect(NoRespawn)
  383.  
  384.  
  385. local function DoMessage(Text, Time)
  386. for i = Time, 0, -1 do
  387. if DoMessageStop == true then
  388. DoMessageStop = nil
  389. return false
  390. end
  391. Message.Text = "Level " ..Level.. " | " ..Text.. " | You have " ..i.. " second" ..(i == 1 and "" or "s").. " left" ..(i <= 10 and "!" or "...")
  392. Message.Parent = Workspace
  393. wait(1)
  394. end
  395. return true
  396. end
  397.  
  398.  
  399. while true do
  400. DoMessage("The zombies are gathering...", math.random(20, 40))
  401. Playing = true
  402. local Time = 60 * ((Level > 10 and 10 or Level) / 3)
  403. local Zombies = {}
  404. coroutine.wrap(function()
  405. while Playing == true do
  406. local Found = false
  407. for _, Player in pairs(game:GetService("Players"):GetPlayers()) do
  408. if Player.Character ~= nil then
  409. Found = true
  410. end
  411. end
  412. if Found == false then
  413. DoMessageStop = true
  414. return
  415. end
  416. if math.random(0, math.max(60 / Level, 10)) == 0 then
  417. table.insert(Zombies, _G.MakeZombie(Vector3.new(math.random(-250, 250), 3, math.random(-250, 250))))
  418. end
  419. wait(0.25)
  420. end
  421. end)()
  422. local Lived = DoMessage("The zombies are attacking!", Time)
  423. Playing = false
  424. if Lived == true then
  425. Playing = false
  426. Message.Text = "The zombies are leaving."
  427. wait(0.5)
  428. Level = Level + 1
  429. else
  430. Message.Text = "Everyone died. Game over!"
  431. wait(0.5)
  432. Level = 1
  433. end
  434. for _, Zombie in pairs(Zombies) do
  435. if Zombie.Parent ~= nil then
  436. pcall(function() Zombie.Humanoid.Health = 0 end)
  437. pcall(function() Zombie:BreakJoints() end)
  438. end
  439. wait(0.1)
  440. end
  441. Message.Text = "Level: " ..Level
  442. wait(3)
  443. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement