roxpli

Zombie Rush

Nov 6th, 2020
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. local delay = 1
  2. local running = false
  3. local sentMessage = false
  4. local player = game.Players.LocalPlayer
  5. local SuperSpeed = false
  6.  
  7. -- Preloading the function names because there were some nil issues
  8. local tzrKeyDown
  9. local tzrKeyUp
  10. local tzr
  11. local unloadAll
  12. local DeadFunc
  13. local tzrWhile
  14. local NotifyUser
  15.  
  16. NotifyUser = function(theMessage)
  17. game.StarterGui:SetCore("ChatMakeSystemMessage", {
  18. Text = theMessage;
  19. Color = Color3.new(0, 0, 1);
  20. })
  21. end
  22.  
  23. DeadFunc = function() end
  24.  
  25. tzrKeyDown = function(inputobject)
  26. if inputobject.KeyCode == Enum.KeyCode.Q then
  27. delay = delay * 1.25
  28. if delay > 5 then delay = 5 end
  29. NotifyUser(tostring(math.floor((1/delay)*100)/100) .. " random zombie kills per second")
  30. elseif inputobject.KeyCode == Enum.KeyCode.E then
  31. delay = delay / 1.25
  32. if delay < 0.001 then delay = 0.001 end
  33. NotifyUser(tostring(math.floor((1/delay)*100)/100) .. " random zombie kills per second")
  34. elseif inputobject.KeyCode == Enum.KeyCode.C then
  35. SuperSpeed = true
  36. NotifyUser("SUPERSPEED")
  37. elseif inputobject.KeyCode == Enum.KeyCode.Z then
  38. if running then
  39. running = false
  40. NotifyUser("TZR Disabled")
  41. else
  42. running = true
  43. NotifyUser("TZR Enabled")
  44. end
  45. tzrWhile()
  46. elseif inputobject.KeyCode == Enum.KeyCode.U then
  47. pcall(unloadAll)
  48. end
  49. end
  50.  
  51. tzrKeyUp = function(inputobject)
  52. if inputobject.KeyCode == Enum.KeyCode.C then
  53. SuperSpeed = false
  54. NotifyUser("SUPERSPEED OFF")
  55. end
  56. end
  57.  
  58. tzr = function()
  59. local zombies = game.Workspace['Zombie Storage']:GetChildren();
  60. for i,zombie in pairs(game.Workspace['Zombie Storage']:GetChildren()) do
  61. if SuperSpeed == false then zombie = zombies[math.random(#zombies)] end
  62. local weaponName = player.EquipStorage.Primary.Value
  63. local weapon
  64. if player.Backpack:FindFirstChild(weaponName) then
  65. weapon = player.Backpack:FindFirstChild(weaponName)
  66. elseif player.Character:FindFirstChild(weaponName) then
  67. weapon = player.Character:FindFirstChild(weaponName)
  68. else
  69. weapon = nil
  70. end
  71. if weapon then
  72. local humanoid = zombie:FindFirstChild('Humanoid')
  73. if humanoid then
  74. spawn(function()
  75. for i=1,10 do
  76. weapon.GunController.RemoteFunction:InvokeServer({['Name'] = weapon.Name, ['HumanoidTables'] = {{['HeadHits'] = 1, ['THumanoid'] = humanoid, ['BodyHits'] = 0}}})
  77. end
  78. end)
  79. end
  80. end
  81. if SuperSpeed == false then return end
  82. end
  83. end
  84.  
  85. tzrWhile = function()
  86. while running == true do
  87. pcall(tzr)
  88. if SuperSpeed then
  89. wait(0.00001)
  90. else
  91. wait(math.floor(delay*100)/100)
  92. end
  93. end
  94. end
  95.  
  96. unloadAll = function()
  97. running = false
  98. tzrKeyUp = DeadFunc
  99. tzrKeyDown = DeadFunc
  100. tzr = DeadFunc
  101. unloadAll = DeadFunc
  102. NotifyUser("TZR unloaded")
  103. NotifyUser = DeadFunc
  104. end
  105. game:GetService("UserInputService").InputBegan:Connect(function(inputobject) tzrKeyDown(inputobject) end)
  106. game:GetService("UserInputService").InputEnded:Connect(function(inputobject) tzrKeyUp(inputobject) end)
  107. NotifyUser("TZR Loaded, Press Z to enable")
Add Comment
Please, Sign In to add comment