Advertisement
KrYn0MoRe

cod zombies v2.5

Sep 4th, 2020 (edited)
2,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 45.07 KB | None | 0 0
  1. -- all made by KrYn0MoRe(AlmightyToast)
  2.  
  3. local zombie_folder = Instance.new("Folder")
  4. zombie_folder.Parent = script
  5. local zombies = {}
  6. local killed = 0
  7. local curr_total_score = #game:GetService("Players"):GetPlayers()*500
  8. local score_to_drop = (#game:GetService("Players"):GetPlayers()*500+2000)
  9. local insta = false
  10. local doublepoints = 1
  11.  
  12. local cf = CFrame.new;
  13. local ang = CFrame.Angles;
  14. local rad = math.rad;
  15. local sin = math.sin;
  16. local cos = math.cos;
  17.  
  18. local function weld(parent, part0, part1, c0, c1)
  19.     local newweld = Instance.new("Weld");
  20.     newweld.Parent = parent;
  21.     newweld.Part0 = part0;
  22.     newweld.Part1 = part1;
  23.     newweld.C0 = c0;
  24.     newweld.C1 = c1;
  25.     return newweld;
  26. end;
  27.  
  28. local anim_ref = {
  29.     Neck_C0 = cf(0, 1, 0) * ang(rad(-90), rad(0), rad(180));
  30.     Neck_C1 = cf(0, -0.5, 0) * ang(rad(-90), rad(0), rad(180));
  31.     Right_Shoulder_C0 = cf(1, 0.5, 0) * ang(rad(0), rad(90), rad(0));
  32.     Right_Shoulder_C1 = cf(-0.5, 0.5, 0) * ang(rad(0), rad(90), rad(0));
  33.     Left_Shoulder_C0 = cf(-1, 0.5, 0) * ang(rad(0), rad(-90), rad(0));
  34.     Left_Shoulder_C1 = cf(0.5, 0.5, 0) * ang(rad(0), rad(-90), rad(0));
  35.     Right_Hip_C0 = cf(1, -1, 0) * ang(rad(0), rad(90), rad(0));
  36.     Right_Hip_C1 = cf(0.5, 1, 0) * ang(rad(0), rad(90), rad(0));
  37.     Left_Hip_C0 = cf(-1, -1, 0) * ang(rad(0), rad(-90), rad(0));
  38.     Left_Hip_C1 = cf(-0.5, 1, 0) * ang(rad(0), rad(-90), rad(0));
  39. };
  40.  
  41. local walk_anim = {
  42.     {
  43.         Enum.EasingDirection.Out;
  44.         anim_ref.Neck_C0;
  45.         anim_ref.Right_Shoulder_C0 * ang(rad(0), rad(0), rad(100));
  46.         anim_ref.Left_Shoulder_C0 * ang(rad(0), rad(0), rad(-90));
  47.         anim_ref.Right_Hip_C0 * ang(rad(0), rad(0), rad(-30));
  48.         anim_ref.Left_Hip_C0 * ang(rad(0), rad(0), rad(-30));
  49.     };
  50.     {
  51.         Enum.EasingDirection.In;
  52.         anim_ref.Neck_C0;
  53.         anim_ref.Right_Shoulder_C0 * ang(rad(0), rad(0), rad(90));
  54.         anim_ref.Left_Shoulder_C0 * ang(rad(0), rad(0), rad(-100));
  55.         anim_ref.Right_Hip_C0 * ang(rad(0), rad(0), rad(0));
  56.         anim_ref.Left_Hip_C0 * ang(rad(0), rad(0), rad(0));
  57.     };
  58.     {
  59.         Enum.EasingDirection.Out;
  60.         anim_ref.Neck_C0;
  61.         anim_ref.Right_Shoulder_C0 * ang(rad(0), rad(0), rad(80));
  62.         anim_ref.Left_Shoulder_C0 * ang(rad(0), rad(0), rad(-90));
  63.         anim_ref.Right_Hip_C0 * ang(rad(0), rad(0), rad(30));
  64.         anim_ref.Left_Hip_C0 * ang(rad(0), rad(0), rad(30));
  65.     };
  66.     {
  67.         Enum.EasingDirection.InOut;
  68.         anim_ref.Neck_C0;
  69.         anim_ref.Right_Shoulder_C0 * ang(rad(0), rad(0), rad(90));
  70.         anim_ref.Left_Shoulder_C0 * ang(rad(0), rad(0), rad(-80));
  71.         anim_ref.Right_Hip_C0 * ang(rad(0), rad(0), rad(0));
  72.         anim_ref.Left_Hip_C0 * ang(rad(0), rad(0), rad(0));
  73.     };
  74. };
  75.  
  76. local function tween_joint(joint, easing_direction, animation_data)
  77.     local tween_data = TweenInfo.new(
  78.         0.1,
  79.         Enum.EasingStyle.Sine,
  80.         easing_direction,
  81.         0,
  82.         false
  83.     );
  84.     local new_tween = game:GetService("TweenService"):Create(
  85.         joint,
  86.         tween_data,
  87.         {C0 = animation_data}
  88.     );
  89.     new_tween:Play();
  90. end;
  91.  
  92. local function animate_joints(table_1, table_2)
  93.     for Integer = 1, #table_1 do
  94.         local Joint = table_1[Integer];
  95.         local Joint_Easing_Direction = table_2[1];
  96.         local Joint_Animation = table_2[Integer + 1];
  97.         tween_joint(Joint, Joint_Easing_Direction, Joint_Animation)
  98.     end;
  99. end;
  100.  
  101. --\/--
  102.  
  103. local function create(walkspeed,health)
  104.     local function sandbox(var,func)
  105.         local env = getfenv(func)
  106.         local newenv = setmetatable({},{
  107.             __index = function(self,k)
  108.                 if k == "script" then
  109.                     return var
  110.                 else
  111.                     return env[k]
  112.                 end
  113.             end,
  114.         })
  115.         setfenv(func, newenv)
  116.         return func
  117.     end
  118.     local cors = {}
  119.     local mas = Instance.new("Model",game:GetService("Lighting"))
  120.     local Model0 = Instance.new("Model")
  121.     local Part1 = Instance.new("Part")
  122.     local SpecialMesh2 = Instance.new("SpecialMesh")
  123.     local Decal3 = Instance.new("Decal")
  124.     local Part4 = Instance.new("Part")
  125.     local Part5 = Instance.new("Part")
  126.     local Part6 = Instance.new("Part")
  127.     local Part7 = Instance.new("Part")
  128.     local Part8 = Instance.new("Part")
  129.     local Humanoid9 = Instance.new("Humanoid")
  130.     local Script10 = Instance.new("Script")
  131.     Model0.Name = "Zombie"
  132.     Model0.Parent = mas
  133.     Model0.PrimaryPart = Part1
  134.     Part1.Name = "Head"
  135.     Part1.Parent = Model0
  136.     Part1.CFrame = CFrame.new(14.4682684, 4.49999714, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  137.     Part1.Position = Vector3.new(14.4682684, 4.49999714, 13.7751303)
  138.     Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  139.     Part1.Size = Vector3.new(2, 1, 1)
  140.     Part1.BrickColor = BrickColor.new("Really black")
  141.     Part1.CanCollide = true
  142.     Part1.TopSurface = Enum.SurfaceType.Smooth
  143.     Part1.brickColor = BrickColor.new("Really red")
  144.     Part1.FormFactor = Enum.FormFactor.Symmetric
  145.     Part1.formFactor = Enum.FormFactor.Symmetric
  146.     SpecialMesh2.Parent = Part1
  147.     SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  148.     Decal3.Name = "face"
  149.     Decal3.Parent = Part1
  150.     Decal3.Texture = "rbxassetid://319473813"
  151.     Part4.Name = "Torso"
  152.     Part4.Parent = Model0
  153.     Part4.CFrame = CFrame.new(14.4682684, 2.99999905, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  154.     Part4.Position = Vector3.new(14.4682684, 2.99999905, 13.7751303)
  155.     Part4.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  156.     Part4.Size = Vector3.new(2, 2, 1)
  157.     Part4.BrickColor = BrickColor.new("Brown")
  158.     Part4.CanCollide = true
  159.     Part4.LeftParamA = 0
  160.     Part4.LeftParamB = 0
  161.     Part4.LeftSurface = Enum.SurfaceType.Smooth
  162.     Part4.RightParamA = 0
  163.     Part4.RightParamB = 0
  164.     Part4.RightSurface = Enum.SurfaceType.Smooth
  165.     Part4.brickColor = BrickColor.new("Really red")
  166.     Part4.FormFactor = Enum.FormFactor.Symmetric
  167.     Part4.formFactor = Enum.FormFactor.Symmetric
  168.     Part5.Name = "Left Arm"
  169.     Part5.Parent = Model0
  170.     Part5.CFrame = CFrame.new(12.9682684, 2.99999905, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  171.     Part5.Position = Vector3.new(12.9682684, 2.99999905, 13.7751303)
  172.     Part5.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  173.     Part5.Size = Vector3.new(1, 2, 1)
  174.     Part5.BrickColor = BrickColor.new("Really black")
  175.     Part5.CanCollide = true
  176.     Part5.brickColor = BrickColor.new("Really red")
  177.     Part5.FormFactor = Enum.FormFactor.Symmetric
  178.     Part5.formFactor = Enum.FormFactor.Symmetric
  179.     Part6.Name = "Right Arm"
  180.     Part6.Parent = Model0
  181.     Part6.CFrame = CFrame.new(15.9682684, 2.99999905, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  182.     Part6.Position = Vector3.new(15.9682684, 2.99999905, 13.7751303)
  183.     Part6.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  184.     Part6.Size = Vector3.new(1, 2, 1)
  185.     Part6.BrickColor = BrickColor.new("Really black")
  186.     Part6.CanCollide = true
  187.     Part6.brickColor = BrickColor.new("Really red")
  188.     Part6.FormFactor = Enum.FormFactor.Symmetric
  189.     Part6.formFactor = Enum.FormFactor.Symmetric
  190.     Part7.Name = "Left Leg"
  191.     Part7.Parent = Model0
  192.     Part7.CFrame = CFrame.new(13.9682684, 1, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  193.     Part7.Position = Vector3.new(13.9682684, 1, 13.7751303)
  194.     Part7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  195.     Part7.Size = Vector3.new(1, 2, 1)
  196.     Part7.BottomSurface = Enum.SurfaceType.Smooth
  197.     Part7.BrickColor = BrickColor.new("Really black")
  198.     Part7.CanCollide = true
  199.     Part7.brickColor = BrickColor.new("Really red")
  200.     Part7.FormFactor = Enum.FormFactor.Symmetric
  201.     Part7.formFactor = Enum.FormFactor.Symmetric
  202.     Part8.Name = "Right Leg"
  203.     Part8.Parent = Model0
  204.     Part8.CFrame = CFrame.new(14.9682684, 1, 13.7751303, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  205.     Part8.Position = Vector3.new(14.9682684, 1, 13.7751303)
  206.     Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  207.     Part8.Size = Vector3.new(1, 2, 1)
  208.     Part8.BottomSurface = Enum.SurfaceType.Smooth
  209.     Part8.BrickColor = BrickColor.new("Really black")
  210.     Part8.CanCollide = true
  211.     Part8.brickColor = BrickColor.new("Really red")
  212.     Part8.FormFactor = Enum.FormFactor.Symmetric
  213.     Part8.formFactor = Enum.FormFactor.Symmetric
  214.     -- @ Brannon1964802
  215.     local Weld11 = weld(Part4, Part4, Part1, anim_ref.Neck_C0, anim_ref.Neck_C1); -- head
  216.     local Weld12 = weld(Part4, Part4, Part5, anim_ref.Right_Shoulder_C0, anim_ref.Right_Shoulder_C1); -- right arm
  217.     local Weld13 = weld(Part4, Part4, Part6, anim_ref.Left_Shoulder_C0, anim_ref.Left_Shoulder_C1); -- left arm
  218.     local Weld14 = weld(Part4, Part4, Part7, anim_ref.Right_Hip_C0, anim_ref.Right_Hip_C1); -- right leg
  219.     local Weld15 = weld(Part4, Part4, Part8, anim_ref.Left_Hip_C0, anim_ref.Left_Hip_C1); -- left leg
  220.     local joints_table = {
  221.         Weld11; -- Neck
  222.         Weld12; -- Right Shoulder
  223.         Weld13; -- Left Shoulder
  224.         Weld14; -- Right Hip
  225.         Weld15; -- Left Hip
  226.     };
  227.     local anim_num = Random.new():NextInteger(1, 4);
  228.     --
  229.     Humanoid9.WalkSpeed = walkspeed
  230.     Humanoid9.AutoJumpEnabled = true
  231.     if insta then
  232.         Humanoid9.MaxHealth = 1
  233.         Humanoid9.Health = 1
  234.     else
  235.         Humanoid9.MaxHealth = health
  236.         Humanoid9.Health = health
  237.     end
  238.     Humanoid9.Parent = Model0
  239.     Humanoid9.LeftLeg = Part7
  240.     Humanoid9.RightLeg = Part8
  241.     Humanoid9.Torso = Part4
  242.     Script10.Parent = Humanoid9
  243.    
  244.     local jumpcol = Instance.new("Part",Humanoid9)
  245.     jumpcol.Size = Vector3.new(4,5,2)
  246.     jumpcol.Anchored = false
  247.     jumpcol.CanCollide = false
  248.     jumpcol.Transparency = 1
  249.  
  250.     local jumpweld = Instance.new("Weld")
  251.     jumpweld.Parent = Part4
  252.     jumpweld.Part0 = Part4
  253.     jumpweld.Part1 = jumpcol
  254.     jumpweld.C0 = Part4.CFrame:Inverse()
  255.     jumpweld.C1 = jumpcol.CFrame:Inverse()
  256.     jumpweld.C0 = CFrame.new(0,0,-2)
  257.    
  258.     jumpcol.Touched:Connect(function(obj)
  259.         if obj and obj.Parent and obj.CanCollide == true and 1 > obj.Transparency and (obj.Size.X+obj.Size.Y+obj.Size.Z) > 3 and (not obj.Parent:FindFirstChildOfClass("Humanoid") and obj.Name:lower() ~= 'base' and obj.Name:lower() ~= 'baseplate') then
  260.             Humanoid9.Jump = true
  261.         end
  262.     end)
  263.  
  264.     local dead = false
  265.  
  266.     for i,v in pairs(Model0:GetChildren()) do
  267.         pcall(function()
  268.             if v:IsA("Part") then
  269.                 v.Anchored = false
  270.                 v.Touched:Connect(function(obj)
  271.                     if obj and obj.Parent then
  272.                         local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
  273.                         if hum and not dead and not hum:FindFirstChild('zombie cod hit') then
  274.                             if hum.Parent.Name == "Zombie" then return end
  275.                             --hum.MaxHealth = 100
  276.                             local confirm = Instance.new("ObjectValue")
  277.                             confirm.Name = 'zombie cod hit'
  278.                             confirm.Parent = hum
  279.                             game:GetService("Debris"):AddItem(confirm,0.5)
  280.                             hum:TakeDamage(40)
  281.                             --hum.MaxHealth = 100
  282.                         end
  283.                     end
  284.                 end)
  285.             end
  286.         end)
  287.     end
  288.  
  289.     table.insert(zombies,#zombies + 1,Model0)
  290.    
  291.     local zombie = Instance.new("Sound",Part4)
  292.     zombie.SoundId = "rbxassetid://575382784"
  293.     zombie.Volume = 0.5
  294.     zombie.Looped = true
  295.     zombie:Play()
  296.     zombie.TimePosition = math.random(0,zombie.TimeLength)
  297.    
  298.     local oldhealth = Humanoid9.Health
  299.    
  300.     Humanoid9.HealthChanged:Connect(function(newhealth)
  301.         if (oldhealth > newhealth) and insta then
  302.             Humanoid9.Health = 0
  303.         end
  304.     end)
  305.    
  306.     Humanoid9.Died:Connect(
  307.         function()
  308.             dead = true
  309.             zombie:Destroy()
  310.             killed += 1
  311.             if insta then
  312.                 curr_total_score += 90*doublepoints
  313.             else
  314.                 curr_total_score += 100*doublepoints
  315.             end
  316.             if curr_total_score >= score_to_drop then
  317.                 --curr_total_score = 0
  318.                 score_to_drop = score_to_drop * 1.15
  319.                 drop_power_up(Part4.CFrame)
  320.             end
  321.             table.remove(zombies,table.find(zombies,Model0))
  322.             Model0:BreakJoints()
  323.             for i,v in pairs(Model0:GetChildren()) do
  324.                 if v:IsA("BasePart") then
  325.                     game:GetService("TweenService"):Create(v,TweenInfo.new(1),{Transparency = 1}):Play()
  326.                 end
  327.             end
  328.             game:GetService("Debris"):AddItem(Model0,3)
  329.             if zombie then
  330.                 zombie:Destroy()
  331.             end
  332.             pcall(function()
  333.                 local deaths = {1851243003,1847611644,1851233093}
  334.                 local died_s = Instance.new("Sound",Part4)
  335.                 died_s.SoundId = "rbxassetid://" .. tostring(deaths[math.random(1,#deaths)])
  336.                 died_s.Volume = 0.5
  337.                 died_s.Parent = Part4
  338.                 died_s:Play()
  339.             end)
  340.         end
  341.     )
  342.    
  343.     table.insert(
  344.         cors,
  345.         sandbox(
  346.             Script10,
  347.             function()
  348.                 local function find_target(pos)
  349.                     local list = game.Workspace:GetChildren()
  350.                     local torso = nil
  351.                     local dist = math.huge
  352.                     local temp = nil
  353.                     local human = nil
  354.                     local temp2 = nil
  355.                     for x = 1, #list do
  356.                         temp2 = list[x]
  357.                         if (temp2.className == "Model") and (temp2.Name ~= "Zombie") then
  358.                             temp = temp2:FindFirstChild("HumanoidRootPart")
  359.                             human = temp2:FindFirstChildOfClass("Humanoid")
  360.                             if (temp ~= nil) and (human ~= nil) and (human.Health > 0)  then
  361.                                 if (temp.Position - pos).magnitude < dist then
  362.                                     torso = temp
  363.                                     dist = (temp.Position - pos).magnitude
  364.                                 end
  365.                             end
  366.                         end
  367.                     end
  368.                     return torso
  369.                 end
  370.                 local pathfindingservice = game:GetService("PathfindingService")
  371.                
  372.                 local function travel(paths)
  373.                     for n,path in pairs(paths) do
  374.                         if path.Action == Enum.PathWaypointAction.Jump then
  375.                             Humanoid9.Jump = true
  376.                         elseif path.Action == Enum.PathWaypointAction.Walk then
  377.                             Humanoid9:MoveTo(path.Position)
  378.                         end
  379.                     end
  380.                 end
  381.                
  382.                 local function find(targ1,targ2)
  383.                     if targ1 and targ2 then else --[[warn("Target(s) non-existant.")]] return end
  384.                     local path = pathfindingservice:FindPathAsync(targ1.Position,targ2.Position)
  385.                     local paths = path:GetWaypoints()
  386.                     if path.Status == Enum.PathStatus.Success then
  387.                         travel(paths)
  388.                     elseif path.Status == Enum.PathStatus.NoPath then
  389.                         --warn("No paths found.")
  390.                     end
  391.                 end
  392.                 --[[
  393.                 spawn(function()
  394.                     while not dead and Part4 do
  395.                         local target = find_target(Part4.Position);
  396.                         if target ~= nil then
  397.                             --script.Parent:MoveTo(target.Position);
  398.                             find(Part4,target);
  399.                         end;
  400.                         wait(Humanoid9.WalkSpeed/(Humanoid9.WalkSpeed*10));
  401.                     end;
  402.                 end);
  403.                 -- @ Brannon1964802
  404.                 spawn(function()
  405.                     while not dead and Part4 do
  406.                         wait(0.1);
  407.                         if anim_num < 4 then
  408.                             anim_num += 1;
  409.                         else
  410.                             anim_num = 1;
  411.                         end;
  412.                         animate_joints(joints_table, walk_anim[anim_num]);
  413.                     end;
  414.                 end);
  415.                 spawn(function()
  416.                     while not dead and Part4 do
  417.                         local target = find_target(Part4.Position);
  418.                         if target ~= nil then
  419.                             --script.Parent:MoveTo(target.Position);
  420.                             find(Part4,target);
  421.                         end;
  422.                         if anim_num < 4 then
  423.                             anim_num += 1;
  424.                         else
  425.                             anim_num = 1;
  426.                         end;
  427.                         animate_joints(joints_table, walk_anim[anim_num]);
  428.                         wait(Humanoid9.WalkSpeed/(Humanoid9.WalkSpeed*10)); -- wait(0.1);
  429.                     end;
  430.                 end);
  431.                 --]]
  432.             end
  433.         )
  434.     )
  435.     for i,v in pairs(mas:GetChildren()) do
  436.         v.Parent = zombie_folder
  437.     end
  438.     for i,v in pairs(mas:GetChildren()) do
  439.         v.Parent = zombie_folder
  440.         pcall(function() v:MakeJoints() end)
  441.     end
  442.     mas:Destroy()
  443.     for i,v in pairs(cors) do
  444.         spawn(function()
  445.             pcall(v)
  446.         end)
  447.     end
  448.     Model0.PrimaryPart.CFrame = Model0.PrimaryPart.CFrame+Vector3.new(math.random(-100,100),100,math.random(-100,100))
  449. end
  450.  
  451. local sgui1,sgui2
  452. local Model0 = Instance.new("Model")
  453. local Part1 = Instance.new("Part")
  454. local Part2 = Instance.new("Part")
  455. local Part3 = Instance.new("Part")
  456. local Part4 = Instance.new("Part")
  457. sgui1 = Instance.new("SurfaceGui")
  458. local TextLabel6 = Instance.new("TextBox")
  459. local TextLabel7 = Instance.new("TextBox")
  460. local TextLabel8 = Instance.new("TextBox")
  461. local TextLabel9 = Instance.new("TextBox")
  462. sgui2 = Instance.new("SurfaceGui")
  463. local TextLabel11 = Instance.new("TextBox")
  464. local TextLabel12 = Instance.new("TextBox")
  465. local TextLabel13 = Instance.new("TextBox")
  466. local TextLabel14 = Instance.new("TextBox")
  467. local Part15 = Instance.new("Part")
  468. local Part16 = Instance.new("Part")
  469. local Part17 = Instance.new("Part")
  470. local Part18 = Instance.new("Part")
  471. local Part19 = Instance.new("Part")
  472. local Part20 = Instance.new("Part")
  473. local Part21 = Instance.new("Part")
  474. Model0.Name = "board"
  475. Model0.Parent = script
  476. Part1.Parent = Model0
  477. Part1.CFrame = CFrame.new(26.5802822, 8.40005589, -10.3351679, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  478. Part1.Orientation = Vector3.new(0, -15.3400002, 0)
  479. Part1.Position = Vector3.new(26.5802822, 8.40005589, -10.3351679)
  480. Part1.Rotation = Vector3.new(0, -15.3400002, 0)
  481. Part1.Color = Color3.new(0.290196, 0.290196, 0.290196)
  482. Part1.Size = Vector3.new(2, 2, 2)
  483. Part1.Anchored = true
  484. Part1.BottomSurface = Enum.SurfaceType.Smooth
  485. Part1.BrickColor = BrickColor.new("Dark taupe")
  486. Part1.Material = Enum.Material.CorrodedMetal
  487. Part1.TopSurface = Enum.SurfaceType.Smooth
  488. Part1.brickColor = BrickColor.new("Dark taupe")
  489. Part1.FormFactor = Enum.FormFactor.Symmetric
  490. Part1.formFactor = Enum.FormFactor.Symmetric
  491. Part1.Shape = Enum.PartType.Ball
  492. Part2.Parent = Model0
  493. Part2.CFrame = CFrame.new(26.5800686, 0.200047001, -10.3355341, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  494. Part2.Orientation = Vector3.new(0, -15.3400002, 0)
  495. Part2.Position = Vector3.new(26.5800686, 0.200047001, -10.3355341)
  496. Part2.Rotation = Vector3.new(0, -15.3400002, 0)
  497. Part2.Color = Color3.new(0.290196, 0.290196, 0.290196)
  498. Part2.Size = Vector3.new(2, 0.400000006, 2)
  499. Part2.Anchored = true
  500. Part2.BottomSurface = Enum.SurfaceType.Smooth
  501. Part2.BrickColor = BrickColor.new("Dark taupe")
  502. Part2.Material = Enum.Material.CorrodedMetal
  503. Part2.TopSurface = Enum.SurfaceType.Smooth
  504. Part2.brickColor = BrickColor.new("Dark taupe")
  505. Part2.FormFactor = Enum.FormFactor.Plate
  506. Part2.formFactor = Enum.FormFactor.Plate
  507. Part3.Parent = Model0
  508. Part3.CFrame = CFrame.new(15.0073481, 0.200421005, -13.5090256, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  509. Part3.Orientation = Vector3.new(0, -15.3400002, 0)
  510. Part3.Position = Vector3.new(15.0073481, 0.200421005, -13.5090256)
  511. Part3.Rotation = Vector3.new(0, -15.3400002, 0)
  512. Part3.Color = Color3.new(0.290196, 0.290196, 0.290196)
  513. Part3.Size = Vector3.new(2, 0.400000006, 2)
  514. Part3.Anchored = true
  515. Part3.BottomSurface = Enum.SurfaceType.Smooth
  516. Part3.BrickColor = BrickColor.new("Dark taupe")
  517. Part3.Material = Enum.Material.CorrodedMetal
  518. Part3.TopSurface = Enum.SurfaceType.Smooth
  519. Part3.brickColor = BrickColor.new("Dark taupe")
  520. Part3.FormFactor = Enum.FormFactor.Plate
  521. Part3.formFactor = Enum.FormFactor.Plate
  522. Part4.Name = "Main"
  523. Part4.Parent = Model0
  524. Part4.CFrame = CFrame.new(20.7938061, 4.80028963, -11.9221039, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  525. Part4.Orientation = Vector3.new(0, -15.3400002, 0)
  526. Part4.Position = Vector3.new(20.7938061, 4.80028963, -11.9221039)
  527. Part4.Rotation = Vector3.new(0, -15.3400002, 0)
  528. Part4.Color = Color3.new(0.623529, 0.631373, 0.67451)
  529. Part4.Size = Vector3.new(10, 6.4000001, 1)
  530. Part4.Anchored = true
  531. Part4.BottomSurface = Enum.SurfaceType.Smooth
  532. Part4.BrickColor = BrickColor.new("Fossil")
  533. Part4.Material = Enum.Material.SmoothPlastic
  534. Part4.TopSurface = Enum.SurfaceType.Smooth
  535. Part4.brickColor = BrickColor.new("Fossil")
  536. Part4.FormFactor = Enum.FormFactor.Plate
  537. Part4.formFactor = Enum.FormFactor.Plate
  538. local PointLight0 = Instance.new("PointLight")
  539. PointLight0.Parent = Part4
  540. PointLight0.Color = Color3.new(0.666667, 0.666667, 0.666667)
  541. PointLight0.Brightness = 7
  542. sgui1.Parent = Part4
  543. sgui1.LightInfluence = 1
  544. sgui1.Face = Enum.NormalId.Back
  545. sgui1.ClipsDescendants = true
  546. sgui1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  547. TextLabel6.Name = "needed"
  548. TextLabel6.Parent = sgui1
  549. TextLabel6.Position = UDim2.new(0, 0, 0.5, 0)
  550. TextLabel6.Size = UDim2.new(1, 0, 0.25, 0)
  551. TextLabel6.BackgroundColor = BrickColor.new("Light grey metallic")
  552. TextLabel6.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  553. TextLabel6.BorderColor = BrickColor.new("Really black")
  554. TextLabel6.BorderColor3 = Color3.new(0, 0, 0)
  555. TextLabel6.Font = Enum.Font.SourceSans
  556. TextLabel6.FontSize = Enum.FontSize.Size14
  557. TextLabel6.Text = "needed to kill: 0"
  558. TextLabel6.TextColor = BrickColor.new("Institutional white")
  559. TextLabel6.TextColor3 = Color3.new(1, 1, 1)
  560. TextLabel6.TextScaled = true
  561. TextLabel6.TextSize = 14
  562. TextLabel6.TextStrokeTransparency = 0
  563. TextLabel6.TextWrap = true
  564. TextLabel6.TextWrapped = true
  565. TextLabel7.Name = "round"
  566. TextLabel7.Parent = sgui1
  567. TextLabel7.Size = UDim2.new(1, 0, 0.25, 0)
  568. TextLabel7.BackgroundColor = BrickColor.new("Light grey metallic")
  569. TextLabel7.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  570. TextLabel7.BorderColor = BrickColor.new("Really black")
  571. TextLabel7.BorderColor3 = Color3.new(0, 0, 0)
  572. TextLabel7.Font = Enum.Font.SourceSans
  573. TextLabel7.FontSize = Enum.FontSize.Size14
  574. TextLabel7.Text = "round: 0"
  575. TextLabel7.TextColor = BrickColor.new("Institutional white")
  576. TextLabel7.TextColor3 = Color3.new(1, 1, 1)
  577. TextLabel7.TextScaled = true
  578. TextLabel7.TextSize = 14
  579. TextLabel7.TextStrokeTransparency = 0
  580. TextLabel7.TextWrap = true
  581. TextLabel7.TextWrapped = true
  582. TextLabel8.Name = "current"
  583. TextLabel8.Parent = sgui1
  584. TextLabel8.Position = UDim2.new(0, 0, 0.25, 0)
  585. TextLabel8.Size = UDim2.new(1, 0, 0.25, 0)
  586. TextLabel8.BackgroundColor = BrickColor.new("Light grey metallic")
  587. TextLabel8.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  588. TextLabel8.BorderColor = BrickColor.new("Really black")
  589. TextLabel8.BorderColor3 = Color3.new(0, 0, 0)
  590. TextLabel8.Font = Enum.Font.SourceSans
  591. TextLabel8.FontSize = Enum.FontSize.Size14
  592. TextLabel8.Text = "zombies: 0"
  593. TextLabel8.TextColor = BrickColor.new("Institutional white")
  594. TextLabel8.TextColor3 = Color3.new(1, 1, 1)
  595. TextLabel8.TextScaled = true
  596. TextLabel8.TextSize = 14
  597. TextLabel8.TextStrokeTransparency = 0
  598. TextLabel8.TextWrap = true
  599. TextLabel8.TextWrapped = true
  600. TextLabel9.Name = "health"
  601. TextLabel9.Parent = sgui1
  602. TextLabel9.Position = UDim2.new(0, 0, 0.75, 0)
  603. TextLabel9.Size = UDim2.new(1, 0, 0.25, 0)
  604. TextLabel9.BackgroundColor = BrickColor.new("Light grey metallic")
  605. TextLabel9.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  606. TextLabel9.BorderColor = BrickColor.new("Really black")
  607. TextLabel9.BorderColor3 = Color3.new(0, 0, 0)
  608. TextLabel9.Font = Enum.Font.SourceSans
  609. TextLabel9.FontSize = Enum.FontSize.Size14
  610. TextLabel9.Text = "zombie healths: 50"
  611. TextLabel9.TextColor = BrickColor.new("Institutional white")
  612. TextLabel9.TextColor3 = Color3.new(1, 1, 1)
  613. TextLabel9.TextScaled = true
  614. TextLabel9.TextSize = 14
  615. TextLabel9.TextStrokeTransparency = 0
  616. TextLabel9.TextWrap = true
  617. TextLabel9.TextWrapped = true
  618. sgui2.Parent = Part4
  619. sgui2.LightInfluence = 1
  620. sgui2.ClipsDescendants = true
  621. sgui2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  622. TextLabel11.Name = "needed"
  623. TextLabel11.Parent = sgui2
  624. TextLabel11.Position = UDim2.new(0, 0, 0.5, 0)
  625. TextLabel11.Size = UDim2.new(1, 0, 0.25, 0)
  626. TextLabel11.BackgroundColor = BrickColor.new("Light grey metallic")
  627. TextLabel11.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  628. TextLabel11.BorderColor = BrickColor.new("Really black")
  629. TextLabel11.BorderColor3 = Color3.new(0, 0, 0)
  630. TextLabel11.Font = Enum.Font.SourceSans
  631. TextLabel11.FontSize = Enum.FontSize.Size14
  632. TextLabel11.Text = "needed to kill: 0"
  633. TextLabel11.TextColor = BrickColor.new("Institutional white")
  634. TextLabel11.TextColor3 = Color3.new(1, 1, 1)
  635. TextLabel11.TextScaled = true
  636. TextLabel11.TextSize = 14
  637. TextLabel11.TextStrokeTransparency = 0
  638. TextLabel11.TextWrap = true
  639. TextLabel11.TextWrapped = true
  640. TextLabel12.Name = "round"
  641. TextLabel12.Parent = sgui2
  642. TextLabel12.Size = UDim2.new(1, 0, 0.25, 0)
  643. TextLabel12.BackgroundColor = BrickColor.new("Light grey metallic")
  644. TextLabel12.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  645. TextLabel12.BorderColor = BrickColor.new("Really black")
  646. TextLabel12.BorderColor3 = Color3.new(0, 0, 0)
  647. TextLabel12.Font = Enum.Font.SourceSans
  648. TextLabel12.FontSize = Enum.FontSize.Size14
  649. TextLabel12.Text = "round: 0"
  650. TextLabel12.TextColor = BrickColor.new("Institutional white")
  651. TextLabel12.TextColor3 = Color3.new(1, 1, 1)
  652. TextLabel12.TextScaled = true
  653. TextLabel12.TextSize = 14
  654. TextLabel12.TextStrokeTransparency = 0
  655. TextLabel12.TextWrap = true
  656. TextLabel12.TextWrapped = true
  657. TextLabel13.Name = "current"
  658. TextLabel13.Parent = sgui2
  659. TextLabel13.Position = UDim2.new(0, 0, 0.25, 0)
  660. TextLabel13.Size = UDim2.new(1, 0, 0.25, 0)
  661. TextLabel13.BackgroundColor = BrickColor.new("Light grey metallic")
  662. TextLabel13.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  663. TextLabel13.BorderColor = BrickColor.new("Really black")
  664. TextLabel13.BorderColor3 = Color3.new(0, 0, 0)
  665. TextLabel13.Font = Enum.Font.SourceSans
  666. TextLabel13.FontSize = Enum.FontSize.Size14
  667. TextLabel13.Text = "zombies: 0"
  668. TextLabel13.TextColor = BrickColor.new("Institutional white")
  669. TextLabel13.TextColor3 = Color3.new(1, 1, 1)
  670. TextLabel13.TextScaled = true
  671. TextLabel13.TextSize = 14
  672. TextLabel13.TextStrokeTransparency = 0
  673. TextLabel13.TextWrap = true
  674. TextLabel13.TextWrapped = true
  675. TextLabel14.Name = "health"
  676. TextLabel14.Parent = sgui2
  677. TextLabel14.Position = UDim2.new(0, 0, 0.75, 0)
  678. TextLabel14.Size = UDim2.new(1, 0, 0.25, 0)
  679. TextLabel14.BackgroundColor = BrickColor.new("Light grey metallic")
  680. TextLabel14.BackgroundColor3 = Color3.new(0.670588, 0.670588, 0.670588)
  681. TextLabel14.BorderColor = BrickColor.new("Really black")
  682. TextLabel14.BorderColor3 = Color3.new(0, 0, 0)
  683. TextLabel14.Font = Enum.Font.SourceSans
  684. TextLabel14.FontSize = Enum.FontSize.Size14
  685. TextLabel14.Text = "zombie healths: 50"
  686. TextLabel14.TextColor = BrickColor.new("Institutional white")
  687. TextLabel14.TextColor3 = Color3.new(1, 1, 1)
  688. TextLabel14.TextScaled = true
  689. TextLabel14.TextSize = 14
  690. TextLabel14.TextStrokeTransparency = 0
  691. TextLabel14.TextWrap = true
  692. TextLabel14.TextWrapped = true
  693. Part15.Parent = Model0
  694. Part15.CFrame = CFrame.new(20.7939053, 8.20028591, -11.921978, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  695. Part15.Orientation = Vector3.new(0, -15.3400002, 0)
  696. Part15.Position = Vector3.new(20.7939053, 8.20028591, -11.921978)
  697. Part15.Rotation = Vector3.new(0, -15.3400002, 0)
  698. Part15.Color = Color3.new(0.290196, 0.290196, 0.290196)
  699. Part15.Size = Vector3.new(10, 0.400000006, 2)
  700. Part15.Anchored = true
  701. Part15.BottomSurface = Enum.SurfaceType.Smooth
  702. Part15.BrickColor = BrickColor.new("Dark taupe")
  703. Part15.Material = Enum.Material.DiamondPlate
  704. Part15.TopSurface = Enum.SurfaceType.Smooth
  705. Part15.brickColor = BrickColor.new("Dark taupe")
  706. Part15.FormFactor = Enum.FormFactor.Plate
  707. Part15.formFactor = Enum.FormFactor.Plate
  708. Part16.Parent = Model0
  709. Part16.CFrame = CFrame.new(26.5801468, 4.20004416, -10.3353882, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  710. Part16.Orientation = Vector3.new(0, -15.3400002, 0)
  711. Part16.Position = Vector3.new(26.5801468, 4.20004416, -10.3353882)
  712. Part16.Rotation = Vector3.new(0, -15.3400002, 0)
  713. Part16.Color = Color3.new(0.290196, 0.290196, 0.290196)
  714. Part16.Size = Vector3.new(2, 7.5999999, 2)
  715. Part16.Anchored = true
  716. Part16.BottomSurface = Enum.SurfaceType.Smooth
  717. Part16.BrickColor = BrickColor.new("Dark taupe")
  718. Part16.Material = Enum.Material.Slate
  719. Part16.TopSurface = Enum.SurfaceType.Smooth
  720. Part16.brickColor = BrickColor.new("Dark taupe")
  721. Part16.FormFactor = Enum.FormFactor.Plate
  722. Part16.formFactor = Enum.FormFactor.Plate
  723. Part17.Parent = Model0
  724. Part17.CFrame = CFrame.new(26.5802383, 8.20008278, -10.3352356, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  725. Part17.Orientation = Vector3.new(0, -15.3400002, 0)
  726. Part17.Position = Vector3.new(26.5802383, 8.20008278, -10.3352356)
  727. Part17.Rotation = Vector3.new(0, -15.3400002, 0)
  728. Part17.Color = Color3.new(0.290196, 0.290196, 0.290196)
  729. Part17.Size = Vector3.new(2, 0.400000006, 2)
  730. Part17.Anchored = true
  731. Part17.BottomSurface = Enum.SurfaceType.Smooth
  732. Part17.BrickColor = BrickColor.new("Dark taupe")
  733. Part17.Material = Enum.Material.CorrodedMetal
  734. Part17.TopSurface = Enum.SurfaceType.Smooth
  735. Part17.brickColor = BrickColor.new("Dark taupe")
  736. Part17.FormFactor = Enum.FormFactor.Plate
  737. Part17.formFactor = Enum.FormFactor.Plate
  738. Part18.Parent = Model0
  739. Part18.CFrame = CFrame.new(15.0075159, 8.20044613, -13.5087223, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  740. Part18.Orientation = Vector3.new(0, -15.3400002, 0)
  741. Part18.Position = Vector3.new(15.0075159, 8.20044613, -13.5087223)
  742. Part18.Rotation = Vector3.new(0, -15.3400002, 0)
  743. Part18.Color = Color3.new(0.290196, 0.290196, 0.290196)
  744. Part18.Size = Vector3.new(2, 0.400000006, 2)
  745. Part18.Anchored = true
  746. Part18.BottomSurface = Enum.SurfaceType.Smooth
  747. Part18.BrickColor = BrickColor.new("Dark taupe")
  748. Part18.Material = Enum.Material.CorrodedMetal
  749. Part18.TopSurface = Enum.SurfaceType.Smooth
  750. Part18.brickColor = BrickColor.new("Dark taupe")
  751. Part18.FormFactor = Enum.FormFactor.Plate
  752. Part18.formFactor = Enum.FormFactor.Plate
  753. Part19.Parent = Model0
  754. Part19.CFrame = CFrame.new(15.0074244, 4.20044899, -13.5088778, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  755. Part19.Orientation = Vector3.new(0, -15.3400002, 0)
  756. Part19.Position = Vector3.new(15.0074244, 4.20044899, -13.5088778)
  757. Part19.Rotation = Vector3.new(0, -15.3400002, 0)
  758. Part19.Color = Color3.new(0.290196, 0.290196, 0.290196)
  759. Part19.Size = Vector3.new(2, 7.5999999, 2)
  760. Part19.Anchored = true
  761. Part19.BottomSurface = Enum.SurfaceType.Smooth
  762. Part19.BrickColor = BrickColor.new("Dark taupe")
  763. Part19.Material = Enum.Material.Slate
  764. Part19.TopSurface = Enum.SurfaceType.Smooth
  765. Part19.brickColor = BrickColor.new("Dark taupe")
  766. Part19.FormFactor = Enum.FormFactor.Plate
  767. Part19.formFactor = Enum.FormFactor.Plate
  768. Part20.Parent = Model0
  769. Part20.CFrame = CFrame.new(15.0075464, 8.40045357, -13.5086679, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  770. Part20.Orientation = Vector3.new(0, -15.3400002, 0)
  771. Part20.Position = Vector3.new(15.0075464, 8.40045357, -13.5086679)
  772. Part20.Rotation = Vector3.new(0, -15.3400002, 0)
  773. Part20.Color = Color3.new(0.290196, 0.290196, 0.290196)
  774. Part20.Size = Vector3.new(2, 2, 2)
  775. Part20.Anchored = true
  776. Part20.BottomSurface = Enum.SurfaceType.Smooth
  777. Part20.BrickColor = BrickColor.new("Dark taupe")
  778. Part20.Material = Enum.Material.CorrodedMetal
  779. Part20.TopSurface = Enum.SurfaceType.Smooth
  780. Part20.brickColor = BrickColor.new("Dark taupe")
  781. Part20.FormFactor = Enum.FormFactor.Symmetric
  782. Part20.formFactor = Enum.FormFactor.Symmetric
  783. Part20.Shape = Enum.PartType.Ball
  784. Part21.Parent = Model0
  785. Part21.CFrame = CFrame.new(20.7939053, 1.40021086, -11.921978, 0.964379668, 3.73066141e-05, -0.264521897, -3.59999867e-05, 1, 9.78730986e-06, 0.264521897, 8.41014369e-08, 0.964379668)
  786. Part21.Orientation = Vector3.new(0, -15.3400002, 0)
  787. Part21.Position = Vector3.new(20.7939053, 1.40021086, -11.921978)
  788. Part21.Rotation = Vector3.new(0, -15.3400002, 0)
  789. Part21.Color = Color3.new(0.290196, 0.290196, 0.290196)
  790. Part21.Size = Vector3.new(10, 0.400000006, 2)
  791. Part21.Anchored = true
  792. Part21.BottomSurface = Enum.SurfaceType.Smooth
  793. Part21.BrickColor = BrickColor.new("Dark taupe")
  794. Part21.Material = Enum.Material.DiamondPlate
  795. Part21.TopSurface = Enum.SurfaceType.Smooth
  796. Part21.brickColor = BrickColor.new("Dark taupe")
  797. Part21.FormFactor = Enum.FormFactor.Plate
  798. Part21.formFactor = Enum.FormFactor.Plate
  799.  
  800. local ws = 13 -- default is 13
  801. local default_health = 50 -- default 50
  802. local health = default_health -- default is default_health
  803. local healthboost = 100 -- default is 100
  804. local cap = 24 -- default is 24
  805. local needed = 9 -- default is cap or 9
  806. local round = 0
  807.  
  808. local in_progress = false
  809.  
  810. local powerups = {
  811.     function(pos) -- insta kill
  812.         local skull = Instance.new("Part")
  813.         local SpecialMesh1 = Instance.new("SpecialMesh")
  814.         skull.Parent = script
  815.         skull.CFrame = CFrame.new(-44.8135376, 6.18395519, 15.4456863, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  816.         skull.Position = Vector3.new(-44.8135376, 6.18395519, 15.4456863)
  817.         skull.Color = Color3.new(1, 1, 0)
  818.         skull.Transparency = 0.30000001192093
  819.         skull.Size = Vector3.new(2.5, 2.5, 2.5)
  820.         skull.Anchored = true
  821.         skull.BrickColor = BrickColor.new("New Yeller")
  822.         skull.CanCollide = false
  823.         skull.Material = Enum.Material.Neon
  824.         skull.brickColor = BrickColor.new("New Yeller")
  825.         SpecialMesh1.Parent = skull
  826.         SpecialMesh1.MeshId = "rbxassetid://4770583"
  827.         SpecialMesh1.Scale = Vector3.new(5, 5, 5)
  828.         SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  829.        
  830.         local sine = 0
  831.         local used = false
  832.        
  833.         skull.CFrame = pos
  834.         skull.Rotation = Vector3.new(0, 0, 0)
  835.        
  836.         spawn(function()
  837.             while skull and not used do
  838.                 sine = sine+5*wait()*30
  839.                 skull.CFrame = skull.CFrame*CFrame.new(0,0 + .05 * math.cos(sine/40),0)*CFrame.Angles(0,math.rad(1),0)
  840.             end
  841.         end)
  842.        
  843.         spawn(function()
  844.             wait(12)
  845.             for i = 1,10 do
  846.                 if not skull or used then break end
  847.                 game:GetService("TweenService"):Create(skull,TweenInfo.new(1/i),{Transparency = 1}):Play()
  848.                 wait(1/i)
  849.                 game:GetService("TweenService"):Create(skull,TweenInfo.new(1/i),{Transparency = 0.3}):Play()
  850.                 wait(1/i)
  851.             end
  852.             game:GetService("TweenService"):Create(skull,TweenInfo.new(1),{Transparency = 1}):Play()
  853.             wait(1)
  854.             if skull and not used then
  855.                 skull:Destroy()
  856.             end
  857.         end)
  858.        
  859.         skull.Touched:Connect(function(obj)
  860.             local char,hum
  861.             pcall(function()
  862.                 char = obj.Parent
  863.             end)
  864.             pcall(function()
  865.                 hum = char:FindFirstChildOfClass("Humanoid")
  866.             end)
  867.             if char and char.Name ~= "Zombie" and hum and hum.Health > 0 then else return end
  868.             used = true
  869.             local powerup = Instance.new("Sound",script)
  870.             powerup.SoundId = "rbxassetid://131961137"
  871.             powerup.Volume = 2
  872.             powerup:Play()
  873.             skull:Destroy()
  874.             spawn(function()
  875.                 for i,v in pairs(zombies) do
  876.                     if v:FindFirstChildOfClass("Humanoid") then
  877.                         v:FindFirstChildOfClass("Humanoid").MaxHealth = 1
  878.                         v:FindFirstChildOfClass("Humanoid").Health = 1
  879.                     end
  880.                 end
  881.                 wait()
  882.                 insta = true
  883.                 wait(30)
  884.                 for i,v in pairs(zombies) do
  885.                     if v:FindFirstChildOfClass("Humanoid") then
  886.                         v:FindFirstChildOfClass("Humanoid").MaxHealth = health
  887.                         v:FindFirstChildOfClass("Humanoid").Health = health
  888.                     end
  889.                 end
  890.                 insta = false
  891.             end)
  892.         end)
  893.     end;
  894.     function(pos) -- nuke
  895.         local nuke = Instance.new("Part")
  896.         local SpecialMesh1 = Instance.new("SpecialMesh")
  897.         nuke.Parent = script
  898.         nuke.CFrame = CFrame.new(-46.8135376, 6.18395519, 17.2851868, 1, 0, 0, 0, -4.37113883e-08, 1, 0, -1, -4.37113883e-08)
  899.         nuke.Orientation = Vector3.new(-90, 0, 0)
  900.         nuke.Position = Vector3.new(-46.8135376, 6.18395519, 17.2851868)
  901.         nuke.Rotation = Vector3.new(-90, 0, 0)
  902.         nuke.Color = Color3.new(1, 1, 0)
  903.         nuke.Transparency = 0.3
  904.         nuke.Size = Vector3.new(2, 4.3210001, 2)
  905.         nuke.Anchored = true
  906.         nuke.BottomSurface = Enum.SurfaceType.Smooth
  907.         nuke.BrickColor = BrickColor.new("New Yeller")
  908.         nuke.CanCollide = false
  909.         nuke.Material = Enum.Material.Neon
  910.         nuke.TopSurface = Enum.SurfaceType.Smooth
  911.         nuke.brickColor = BrickColor.new("New Yeller")
  912.         SpecialMesh1.Parent = nuke
  913.         SpecialMesh1.MeshId = "rbxassetid://1365466023"
  914.         SpecialMesh1.Scale = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  915.         SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  916.        
  917.         local sine = 0
  918.         local used = false
  919.        
  920.         nuke.CFrame = pos
  921.         nuke.Rotation = Vector3.new(-90, 0, 0)
  922.        
  923.         spawn(function()
  924.             while nuke and not used do
  925.                 sine = sine+5*wait()*30
  926.                 nuke.CFrame = nuke.CFrame*CFrame.new(0,0,0 + .05 * math.cos(sine/40))*CFrame.Angles(0,0,math.rad(1))
  927.             end
  928.         end)
  929.        
  930.         spawn(function()
  931.             wait(12)
  932.             for i = 1,10 do
  933.                 if not nuke or used then break end
  934.                 game:GetService("TweenService"):Create(nuke,TweenInfo.new(1/i),{Transparency = 1}):Play()
  935.                 wait(1/i)
  936.                 game:GetService("TweenService"):Create(nuke,TweenInfo.new(1/i),{Transparency = 0.3}):Play()
  937.                 wait(1/i)
  938.             end
  939.             game:GetService("TweenService"):Create(nuke,TweenInfo.new(1),{Transparency = 1}):Play()
  940.             wait(1)
  941.             if nuke and not used then
  942.                 nuke:Destroy()
  943.             end
  944.         end)
  945.        
  946.         nuke.Touched:Connect(function(obj)
  947.             local char,hum
  948.             pcall(function()
  949.                 char = obj.Parent
  950.             end)
  951.             pcall(function()
  952.                 hum = char:FindFirstChildOfClass("Humanoid")
  953.             end)
  954.             if char and char.Name ~= "Zombie" and hum and hum.Health > 0 then else return end
  955.             used = true
  956.             local powerup = Instance.new("Sound",script)
  957.             powerup.SoundId = "rbxassetid://131961140"
  958.             powerup.Volume = 2
  959.             powerup:Play()
  960.             nuke:Destroy()
  961.             for i,v in pairs(zombies) do
  962.                 if v:FindFirstChildOfClass("Humanoid") then
  963.                     v:FindFirstChildOfClass("Humanoid").Health = 0
  964.                 end
  965.             end
  966.         end)
  967.     end;
  968.     function(pos) -- x2
  969.         local x2 = Instance.new("Part")
  970.         local SpecialMesh1 = Instance.new("SpecialMesh")
  971.         x2.Name = "x2"
  972.         x2.Parent = workspace
  973.         x2.CFrame = CFrame.new(39.7900085, 1.5, 15.2500124, 1, 4.37113847e-08, 4.37113918e-08, 4.37113954e-08, 7.91139954e-15, -1, -4.37113883e-08, 1, 4.35868543e-15)
  974.         x2.Orientation = Vector3.new(90, 0, 0)
  975.         x2.Position = Vector3.new(39.7900085, 1.5, 15.2500124)
  976.         x2.Rotation = Vector3.new(90, 0, 0)
  977.         x2.Color = Color3.new(1, 1, 0)
  978.         x2.Transparency = 0.30000001192093
  979.         x2.Size = Vector3.new(2.5, 2.5, 2.5)
  980.         x2.Anchored = true
  981.         x2.CanCollide = false
  982.         x2.BottomSurface = Enum.SurfaceType.Smooth
  983.         x2.BrickColor = BrickColor.new("New Yeller")
  984.         x2.Material = Enum.Material.Neon
  985.         x2.TopSurface = Enum.SurfaceType.Smooth
  986.         x2.brickColor = BrickColor.new("New Yeller")
  987.         SpecialMesh1.Parent = x2
  988.         SpecialMesh1.MeshId = "rbxassetid://920722180"
  989.         SpecialMesh1.Scale = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  990.         SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  991.        
  992.         local sine = 0
  993.         local used = false
  994.        
  995.         x2.CFrame = pos
  996.         x2.Rotation = Vector3.new(90, 0, 0)
  997.        
  998.         spawn(function()
  999.             while x2 and not used do
  1000.                 sine = sine+5*wait()*30
  1001.                 x2.CFrame = x2.CFrame*CFrame.new(0,0,0 + .05 * math.cos(sine/40))*CFrame.Angles(0,0,math.rad(1))
  1002.             end
  1003.         end)
  1004.        
  1005.         spawn(function()
  1006.             wait(12)
  1007.             for i = 1,10 do
  1008.                 if not x2 or used then break end
  1009.                 game:GetService("TweenService"):Create(x2,TweenInfo.new(1/i),{Transparency = 1}):Play()
  1010.                 wait(1/i)
  1011.                 game:GetService("TweenService"):Create(x2,TweenInfo.new(1/i),{Transparency = 0.3}):Play()
  1012.                 wait(1/i)
  1013.             end
  1014.             game:GetService("TweenService"):Create(x2,TweenInfo.new(1),{Transparency = 1}):Play()
  1015.             wait(1)
  1016.             if x2 and not used then
  1017.                 x2:Destroy()
  1018.             end
  1019.         end)
  1020.        
  1021.         x2.Touched:Connect(function(obj)
  1022.             local char,hum
  1023.             pcall(function()
  1024.                 char = obj.Parent
  1025.             end)
  1026.             pcall(function()
  1027.                 hum = char:FindFirstChildOfClass("Humanoid")
  1028.             end)
  1029.             if char and char.Name ~= "Zombie" and hum and hum.Health > 0 then else return end
  1030.             used = true
  1031.             local powerup = Instance.new("Sound",script)
  1032.             powerup.SoundId = "rbxassetid://131149750"
  1033.             powerup.Volume = 2
  1034.             powerup:Play()
  1035.             x2:Destroy()
  1036.             spawn(function()
  1037.                 doublepoints = 2
  1038.                 wait(30)
  1039.                 doublepoints = 1
  1040.             end)
  1041.         end)
  1042.     end;
  1043. }
  1044.  
  1045. function drop_power_up(pos)
  1046.     curr_total_score = 0
  1047.     powerups[math.random(1,#powerups)](pos)
  1048. end
  1049.  
  1050. function round_set()
  1051.     round += 1
  1052.     if 10 > round then
  1053.         health = default_health+(round*healthboost)
  1054.     else
  1055.         health = health+(health*0.1)
  1056.     end
  1057.     cap = 24+(#game:GetService("Players"):GetPlayers()-1)*6
  1058.     if cap > 50 then
  1059.         cap = 50
  1060.     end
  1061.     --needed = (round*0.15)*cap
  1062.     --cap = 24
  1063.     needed += 3
  1064.     killed = 0
  1065.     insta = false
  1066. end
  1067.  
  1068. spawn(function()
  1069.     while true do
  1070.         local round_start = Instance.new("Sound",script)
  1071.         round_start.SoundId = "rbxassetid://2564305185"
  1072.         round_start.Volume = 2
  1073.         round_start:Play()
  1074.         wait(2)
  1075.         round_set()
  1076.         in_progress = true
  1077.         repeat wait(1) until killed >= needed
  1078.         in_progress = false
  1079.         local round_end = Instance.new("Sound",script)
  1080.         round_end.SoundId = "rbxassetid://2564305451"
  1081.         round_end.Volume = 2
  1082.         round_end:Play()
  1083.         repeat wait(0.1) until not round_end.IsPlaying
  1084.         for i,v in pairs(zombies) do
  1085.             table.remove(zombies,i)
  1086.         end
  1087.     end
  1088. end)
  1089.  
  1090. local function find_target(pos)
  1091.     local list = game.Workspace:GetChildren()
  1092.     local torso = nil
  1093.     local dist = math.huge
  1094.     local temp = nil
  1095.     local human = nil
  1096.     local temp2 = nil
  1097.     for x = 1, #list do
  1098.         temp2 = list[x]
  1099.         if (temp2.className == "Model") and temp2.Name ~= "Zombie" and not temp2:IsDescendantOf(script) then
  1100.             temp = temp2:FindFirstChild("HumanoidRootPart")
  1101.             human = temp2:FindFirstChildOfClass("Humanoid")
  1102.             if (temp ~= nil) and (human ~= nil) and (human.Health > 0)  then
  1103.                 if (temp.Position - pos).magnitude < dist then
  1104.                     torso = temp
  1105.                     dist = (temp.Position - pos).magnitude
  1106.                 end
  1107.             end
  1108.         end
  1109.     end
  1110.     return torso
  1111. end
  1112. local pathfindingservice = game:GetService("PathfindingService")
  1113.  
  1114. local function checkw(t)
  1115.     local ci = 3
  1116.     if ci > #t then
  1117.         ci = 3
  1118.     end
  1119.     if t[ci] == nil and ci < #t then
  1120.         repeat ci = ci + 1 wait() until t[ci] ~= nil
  1121.         return Vector3.new(1,0,0) + t[ci]
  1122.     else
  1123.         ci = 3
  1124.         return t[ci]
  1125.     end
  1126. end
  1127.  
  1128. local function travel(paths,h)
  1129.     local confirm = Instance.new("ObjectValue")
  1130.     confirm.Name = 'Moving'
  1131.     confirm.Parent = h
  1132.     for n,path in pairs(paths) do
  1133.         if path.Action == Enum.PathWaypointAction.Jump then
  1134.             h.Jump = true
  1135.         else
  1136.             h:MoveTo(paths)
  1137.         end
  1138.     end
  1139.     pcall(function()
  1140.         h:FindFirstChild("Moving"):Destroy()
  1141.     end)
  1142. end
  1143. local function find(targ1,targ2,h)
  1144.     if targ1 and targ2 and not h:FindFirstChild("Moving") then else --[[warn("Target(s) non-existant.")]] return end
  1145.     local path = pathfindingservice:FindPathAsync(targ1.Position,targ2.Position)
  1146.     local paths = path:GetWaypoints()
  1147.     if path.Status == Enum.PathStatus.Success then
  1148.         spawn(function()
  1149.             travel(targ1,targ2,paths,h);
  1150.         end);
  1151.     elseif path.Status == Enum.PathStatus.NoPath then
  1152.         --warn("No paths found.")
  1153.     end
  1154. end
  1155.  
  1156. local sw = 0
  1157.  
  1158. function swait()
  1159.     sw += 1
  1160.     if sw >= 50 then
  1161.         wait(0); sw = 0;
  1162.     end
  1163. end
  1164.  
  1165. spawn(function()
  1166.     while true do
  1167.         for i,v in pairs(zombies) do
  1168.             local h = v:FindFirstChildOfClass("Humanoid")
  1169.             local rp = v:FindFirstChild("Torso") or v:FindFirstChild("Head")
  1170.             if v and v.Parent and h and rp then
  1171.                 local target = find_target(rp.Position);
  1172.                 if target ~= nil then
  1173.                     h:MoveTo(target.Position);
  1174.                     --find(rp,target,h);
  1175.                 end;
  1176.             else
  1177.                 table.remove(zombies,i);
  1178.                 killed += 1;
  1179.             end;
  1180.             swait();
  1181.         end
  1182.         wait(0.1);
  1183.     end
  1184. end)
  1185.  
  1186. spawn(function()
  1187.     while true do
  1188.         if in_progress and cap > #zombies and needed > killed and (needed-killed) > #zombies then
  1189.             create(ws,health)
  1190.         end
  1191.         for i,v in pairs(sgui1:GetChildren()) do
  1192.             if v.Name == 'current' then
  1193.                 v.Text = 'zombies alive: ' .. tostring(#zombies)
  1194.             elseif v.Name == 'needed' then
  1195.                 v.Text = 'zombies to kill: ' .. tostring(needed-killed)
  1196.             elseif v.Name == 'round' then
  1197.                 v.Text = 'round: ' .. tostring(round)
  1198.             elseif v.Name == 'health' then
  1199.                 v.Text = 'zombie healths: ' .. tostring(math.floor(health))
  1200.             end
  1201.         end
  1202.         for i,v in pairs(sgui2:GetChildren()) do
  1203.             if v.Name == 'current' then
  1204.                 v.Text = 'zombies alive: ' .. tostring(#zombies)
  1205.             elseif v.Name == 'needed' then
  1206.                 v.Text = 'zombies to kill: ' .. tostring(needed-killed)
  1207.             elseif v.Name == 'round' then
  1208.                 v.Text = 'round: ' .. tostring(round)
  1209.             elseif v.Name == 'health' then
  1210.                 v.Text = 'zombie healths: ' .. tostring(health)
  1211.             end
  1212.         end
  1213.         cap = 24+(#game:GetService("Players"):GetPlayers()-1)*6
  1214.         wait(1)
  1215.     end
  1216. end)
  1217.  
  1218. local plr = owner
  1219.  
  1220. plr.Chatted:Connect(function(msg)
  1221.     if msg:lower():sub(1,6) == "spawn/" then
  1222.         local choice = msg:sub(7)
  1223.         if tonumber(choice) then
  1224.             spawn(function()
  1225.                 for i = 0,choice,1 do
  1226.                     create(ws,health)
  1227.                     wait()
  1228.                 end
  1229.             end)
  1230.             warn("Spawned " ..choice.. " zombie(s).")
  1231.         end
  1232.     end
  1233.     if msg:lower():sub(1,5) == "nuke/" then
  1234.         local powerup = Instance.new("Sound",script)
  1235.         powerup.SoundId = "rbxassetid://131961140"
  1236.         powerup.Volume = 2
  1237.         powerup:Play()
  1238.         for i,v in pairs(zombies) do
  1239.             if v:FindFirstChildOfClass("Humanoid") then
  1240.                 v:FindFirstChildOfClass("Humanoid").Health = 0
  1241.             end
  1242.         end
  1243.         warn("Nuked all zombies.")
  1244.     end
  1245.     if msg:lower():sub(1,6) == "insta/" then
  1246.         local choice = msg:sub(7)
  1247.         if tonumber(choice) then
  1248.             local powerup = Instance.new("Sound",script)
  1249.             powerup.SoundId = "rbxassetid://131961137"
  1250.             powerup.Volume = 2
  1251.             powerup:Play()
  1252.             spawn(function()
  1253.                 insta = true
  1254.                 for i,v in pairs(zombies) do
  1255.                     if v:FindFirstChildOfClass("Humanoid") then
  1256.                         v:FindFirstChildOfClass("Humanoid").MaxHealth = 1
  1257.                         v:FindFirstChildOfClass("Humanoid").Health = 1
  1258.                     end
  1259.                 end
  1260.                 wait(choice)
  1261.                 warn("Insta-kill is now gone.")
  1262.                 for i,v in pairs(zombies) do
  1263.                     if v:FindFirstChildOfClass("Humanoid") then
  1264.                         v:FindFirstChildOfClass("Humanoid").MaxHealth = health
  1265.                         --v:FindFirstChildOfClass("Humanoid").Health = health
  1266.                     end
  1267.                 end
  1268.                 insta = false
  1269.             end)
  1270.             warn("Zombies are now insta-kill for " ..choice.. " seconds.")
  1271.         end
  1272.     end
  1273.     if msg:lower():sub(1,6) == "round/" then
  1274.         local choice = msg:sub(7)
  1275.         choice = math.floor(choice)
  1276.         if tonumber(choice) and choice > 0 then
  1277.             round = choice
  1278.             killed = needed
  1279.             if round > 10 then
  1280.                 health = default_health+(healthboost*9)
  1281.             elseif 10 > round then
  1282.                 health = default_health+(healthboost*round)
  1283.             end
  1284.             if round > 10 then
  1285.                 for i = 1,round-10 do
  1286.                     health = health+(health*0.1)
  1287.                 end
  1288.             end
  1289.             local powerup = Instance.new("Sound",script)
  1290.             powerup.SoundId = "rbxassetid://131961140"
  1291.             powerup.Volume = 2
  1292.             powerup:Play()
  1293.             for i,v in pairs(zombies) do
  1294.                 if v:FindFirstChildOfClass("Humanoid") then
  1295.                     v:FindFirstChildOfClass("Humanoid").Health = 0
  1296.                 end
  1297.             end
  1298.             wait(1.5)
  1299.             needed = 24+(3*round)
  1300.             warn("Round is now: " .. round .. ".")
  1301.         end
  1302.     end
  1303. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement