Advertisement
Meliodas0_0

SHOOTS THROUGH WALLS Strucid

Sep 28th, 2019
2,503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. pcall(function()
  2. game:GetService("Workspace"):FindFirstChild("Map").Parent = game:GetService("Workspace").IgnoreThese
  3. game:GetService("Workspace"):FindFirstChild("BuildStuff").Parent = game:GetService("Workspace").IgnoreThese
  4. end)
  5.  
  6. local map = game:GetService("Workspace").IgnoreThese.Map
  7. local bStuff = game:GetService("Workspace").IgnoreThese.BuildStuff
  8.  
  9. local localPlayer = game:GetService("Players").LocalPlayer
  10. local mouse = localPlayer:GetMouse()
  11. local teamCheck = true
  12.  
  13. local function getClosestPlayer()
  14. local closestPlayer = nil
  15. local shortestDistance = math.huge
  16.  
  17. for i, v in pairs(game:GetService("Players"):GetPlayers()) do
  18. if v.Name ~= localPlayer.Name then
  19. if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and teamCheck and v.Team ~= localPlayer.Team then
  20. local magnitude = (v.Character.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
  21.  
  22. if magnitude < shortestDistance then
  23. closestPlayer = v
  24. shortestDistance = magnitude
  25. end
  26. elseif v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Head") and not teamCheck then
  27. local magnitude = (v.Character.HumanoidRootPart.Position - localPlayer.Character.HumanoidRootPart.Position).magnitude
  28.  
  29. if magnitude < shortestDistance then
  30. closestPlayer = v
  31. shortestDistance = magnitude
  32. end
  33. end
  34. end
  35. end
  36.  
  37. return closestPlayer or localPlayer
  38. end
  39.  
  40. game:GetService("UserInputService").InputBegan:Connect(function(input, onGui)
  41. if onGui then return end
  42.  
  43. if input.KeyCode == Enum.KeyCode.T then
  44. teamCheck = not teamCheck
  45. end
  46. end)
  47.  
  48. local mt = getrawmetatable(game)
  49. local oldIndex = mt.__index
  50. setreadonly(mt, false)
  51.  
  52. mt.__index = newcclosure(function(t, k)
  53. if tostring(k) == "Map" then
  54. return map
  55. end
  56. if tostring(k) == "BuildStuff" then
  57. return bStuff
  58. end
  59. if t == mouse and tostring(k) == "Hit" then
  60. return getClosestPlayer().Character.Head.CFrame
  61. end
  62.  
  63. return oldIndex(t, k)
  64. end)
  65.  
  66. setreadonly(mt, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement