Advertisement
lilniggr

Zombie uprising script | works on mobile

Mar 17th, 2023
6,674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.84 KB | None | 0 0
  1. --not mine
  2. --I stopped obfuscating bc its sus lol: https://www.youtube.com/@somac8400
  3. local zombies = game:GetService("Workspace").Zombies
  4. local Players = game:GetService("Players")
  5. local LocalPlayer = Players.LocalPlayer
  6. local mouse = LocalPlayer:GetMouse()
  7. local Camera = workspace.CurrentCamera
  8. local Debris = game:GetService("Debris")
  9. local UserInputService = game:GetService("UserInputService")
  10. local target = false
  11. local RunService = game:GetService("RunService")
  12.  
  13. getfenv().lock = "Random" -- Head or Hitbox or Random
  14.  
  15. fov = 99999
  16. local fovCircle = true
  17. local st = tonumber(tick())
  18. warn("Loading script...")
  19.  
  20. if fovCircle then
  21. function createcircle()
  22. local a = Drawing.new("Circle")
  23. a.Transparency = 1
  24. a.Thickness = 1.5
  25. a.Visible = true
  26. a.Color = Color3.fromRGB(0, 255, 149)
  27. a.Filled = false
  28. a.Radius = fov
  29. return a
  30. end
  31. local fovc = createcircle()
  32. spawn(
  33. function()
  34. RunService:BindToRenderStep(
  35. "FovCircle",
  36. 1,
  37. function()
  38. fovc.Position = Vector2.new(mouse.X, mouse.Y)
  39. end
  40. )
  41. end
  42. )
  43. end
  44.  
  45. -- function isFfa()
  46. -- local am = #Players:GetChildren();
  47. -- local amm = 0;
  48. -- for i , v in pairs(Players:GetChildren()) do
  49. -- if v.Team == LocalPlayer.Team then
  50. -- amm = amm + 1;
  51. -- end;
  52. -- end;
  53. -- return am == amm;
  54. --end;
  55. function getnearest()
  56. local nearestmagnitude = math.huge
  57. local nearestenemy = nil
  58. local vector = nil
  59. --local ffa = isFfa();
  60. for i, v in next, zombies:GetChildren() do
  61. if v and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("Humanoid") and v.Humanoid.Health > 0 then
  62. local vector, onScreen = Camera:WorldToScreenPoint(v["HumanoidRootPart"].Position)
  63. if onScreen then
  64. local ray = Ray.new(Camera.CFrame.p, (v["Head"].Position - Camera.CFrame.p).unit * 500)
  65. local ignore = {
  66. LocalPlayer.Character
  67. }
  68. local hit, position, normal = workspace:FindPartOnRayWithIgnoreList(ray, ignore)
  69. if
  70. hit and hit:FindFirstAncestorOfClass("Model") and
  71. zombies:FindFirstChild(hit:FindFirstAncestorOfClass("Model").Name)
  72. then
  73. local magnitude = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
  74. if magnitude < nearestmagnitude and magnitude <= fov then
  75. nearestenemy = v
  76. nearestmagnitude = magnitude
  77. end
  78. end
  79. end
  80. end
  81. end
  82. return nearestenemy
  83. end
  84.  
  85. local meta = getrawmetatable(game)
  86. setreadonly(meta, false)
  87. local oldNamecall = meta.__namecall
  88. meta.__namecall =
  89. newcclosure(
  90. function(...)
  91. local method = getnamecallmethod()
  92. local args = {...}
  93. if string.find(method, "Ray") then
  94. if target then
  95. if args[1].Name ~= "Workspace" then
  96. print(args[1])
  97. end
  98. args[2] =
  99. Ray.new(
  100. workspace.CurrentCamera.CFrame.Position,
  101. (target.Position +
  102. Vector3.new(0, (workspace.CurrentCamera.CFrame.Position - target.Position).Magnitude / 500, 0) -
  103. workspace.CurrentCamera.CFrame.Position).unit * 5000
  104. )
  105. end
  106. end
  107. return oldNamecall(unpack(args))
  108. end
  109. )
  110.  
  111. warn("Script loaded!\nTime taken: " .. math.abs(tonumber(tick()) - st))
  112. RunService:BindToRenderStep(
  113. "SilentAim",
  114. 1,
  115. function()
  116. if
  117. UserInputService:IsMouseButtonPressed(0) and Players.LocalPlayer.Character and
  118. Players.LocalPlayer.Character:FindFirstChild("Humanoid") and
  119. Players.LocalPlayer.Character.Humanoid.Health > 0
  120. then
  121. local enemy = getnearest()
  122. if enemy and enemy:FindFirstChild("Humanoid") and enemy.Humanoid.Health > 0 then
  123. local vector, onScreen = Camera:WorldToScreenPoint(enemy["Head"].Position)
  124. local head = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
  125. local vector, onScreen = Camera:WorldToScreenPoint(enemy["HumanoidRootPart"].Position)
  126. local hitbox = (Vector2.new(mouse.X, mouse.Y) - Vector2.new(vector.X, vector.Y)).magnitude
  127. if head <= hitbox then
  128. magnitude = head
  129. else
  130. magnitude = hitbox
  131. end
  132. if getfenv().lock == "Head" then
  133. target = workspace.Zombies[enemy.Name]["Head"]
  134. else
  135. if getfenv().lock == "Random" then
  136. if magnitude == hitbox then
  137. target = zombies[enemy.Name]["HumanoidRootPart"]
  138. else
  139. target = zombies[enemy.Name]["Head"]
  140. end
  141. else
  142. target = zombies[enemy.Name]["HumanoidRootPart"]
  143. end
  144. end
  145. else
  146. target = nil
  147. end
  148. end
  149. end
  150. )
  151. local spread1 = {
  152. Increase = 0,
  153. Decrease = 0,
  154. Max = 0,
  155. Min = 0
  156. }
  157. local rec = {
  158. Tilt = { 0, 0 },
  159. Side = { 0, 0 },
  160. Vertical = { 0, 0 },
  161. Back = { 0, 0 },
  162. Aimed = 0,
  163. FirstShot = 0
  164. }
  165. for i,v in pairs(getgc(true)) do
  166. if type(v) == 'table' and rawget(v, 'magsize') then
  167. v.magsize = math.huge
  168. v.storedammo = math.huge
  169. v.rpm = math.huge
  170. v.spread = spread1
  171. v.recoil = rec
  172. v.mode = "Auto"
  173. end
  174. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement