Advertisement
Honansik

Trenches: Alpha GUI Script

Dec 18th, 2021
19,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.25 KB | None | 0 0
  1. --//Declarations
  2. local SilentAim = {
  3.     Enabled = false,
  4.     FOV = false,
  5.     FOVSize = 100,
  6.     Accuracy = 100,
  7.     Target = "Head"
  8. }
  9. local players = game:GetService("Players")
  10. local plr = players.LocalPlayer
  11. local mouse = plr:GetMouse()
  12. local camera = game.Workspace.CurrentCamera
  13.  
  14.  
  15. local FOVCircle = Drawing.new("Circle")
  16. FOVCircle.Position = Vector2.new(0, 0)
  17. FOVCircle.Radius = 100
  18. FOVCircle.Color = Color3.fromRGB(255, 255, 255)
  19. FOVCircle.Thickness = 1
  20. FOVCircle.Filled = false
  21. FOVCircle.Visible = false
  22. FOVCircle.Transparency = 1
  23. FOVCircle.NumSides = 50
  24.  
  25. --//ESP
  26. local ESP = loadstring(game:HttpGet("https://raw.githubusercontent.com/Anomaly-hub/Anomalies-Scripts/main/kiriots%20esp", true))()
  27. ESP.Players = true
  28. ESP.Tracers = false
  29. ESP.Boxes = true
  30. local Lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/AnomalyRBLX/Database/main/Libraries/Jan's%20UI%20Copy.lua", true))();
  31. local window = Lib:CreateWindow("Trenches - Alpha", Vector2.new(492, 440), Enum.KeyCode.RightShift)
  32.  
  33. local Main = window:CreateTab("Main")
  34. local MS = Main:CreateSector("Silent Aim", "left")
  35.  
  36. MS:AddToggle("Enabled", SilentAim.Enabled, function(state)
  37.     SilentAim.Enabled = state
  38. end)
  39.  
  40. MS:AddSlider("Accuracy", 1, 100, 100, 1, function(s)
  41.     SilentAim.Accuracy = s
  42. end)
  43.  
  44. local bodyParts = {"Head", "HumanoidRootPart"}
  45. MS:AddDropdown("Target", {"Random", "Head", "HumanoidRootPart"}, "Random", false, function(selected)
  46.     SilentAim.Target = selected
  47. end)
  48.  
  49. MS:AddToggle("FOV Circle", false, function(s)
  50.     SilentAim.FOV = s
  51.     FOVCircle.Visible = s
  52. end)
  53.  
  54. MS:AddSlider("Size", 10, 100, 500, 1, function(v)
  55.     FOVCircle.Radius = v
  56.     SilentAim.FOVSize = v
  57. end)
  58.  
  59. function updateFOV()
  60.     FOVCircle.Position = Vector2.new(mouse.X, mouse.Y+36)
  61. end
  62.  
  63. MS:AddButton("Mod Guns", function()
  64.     for _,v in pairs(game:GetService("Players").LocalPlayer.Backpack:GetDescendants()) do
  65.         if v:IsA("NumberValue") then
  66.             if v.Name == "FireRate" then
  67.                 v.Value = 0.01
  68.             elseif v.Name == "ReloadingTime" then
  69.                 v.Value = 0.01
  70.             elseif v.Name == "Spread" then
  71.                 v.Value = 0
  72.             elseif v.Name == "CameraShake" then
  73.                 v.Value = false
  74.             end
  75.         end
  76.     end
  77. end)
  78.  
  79. local AuraDist = 6
  80. MS:AddSlider("Melee Aura Distance", 1,6,6,1, function(s)
  81.     AuraDist = s
  82. end)
  83.  
  84. local Meele = false
  85. MS:AddToggle("Melee Aura", false, function(s)
  86.     Meele = s
  87.     while s and Meele and wait() do
  88.         local plr = game.Players.LocalPlayer
  89.         for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  90.             if v.Character and v.Character:FindFirstChild("HumanoidRootPart") and v.Name ~= plr.Name and v.TeamColor ~= plr.TeamColor then
  91.                 print("Sh")
  92.                 local check = (v.Character.HumanoidRootPart.Position - plr.Character.HumanoidRootPart.Position).Magnitude
  93.                 if check <= AuraDist then
  94.                     print("SH")
  95.                     game:GetService("ReplicatedStorage").MeleeEvent:FireServer(game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Tool"))
  96.                 end
  97.             end
  98.         end
  99.     end
  100. end)
  101. MS:AddLabel("Created by Anomaly#2000")
  102.  
  103. local ES = Main:CreateSector("ESP", "right")
  104. ES:AddToggle("Enabled", false, function(s)
  105.     ESP:Toggle(s)
  106. end)
  107.  
  108. ES:AddToggle("Boxes", true, function(s)
  109.     ESP.Boxes = s
  110. end)
  111.  
  112. ES:AddToggle("Tracers", false, function(s)
  113.     ESP.Tracers = s
  114. end)
  115.  
  116. ES:AddToggle("Names", true, function(s)
  117.     ESP.Names = s
  118. end)
  119.  
  120. local GPS = Main:CreateSector("Gameplay", "left")
  121. GPS:AddButton("Faster Building", function()
  122.     game.Players.LocalPlayer.Backpack:FindFirstChild("Build"):FindFirstChild("BuildMain"):FindFirstChild("Variables"):FindFirstChild("WorkDelay").Value = 0.01
  123. end)
  124.  
  125. local BuildAura = false
  126. local work = function()
  127.     local dist = math.huge
  128.     local targ
  129.     local lPlr = game.Players.LocalPlayer.Character.HumanoidRootPart.Position
  130.     for _,v in pairs(game:GetService("Workspace"):FindFirstChild("Structures"):GetChildren()) do
  131.         if string.find(v.Name, "Construction") then
  132.             local check = (v:FindFirstChildWhichIsA("Part").Position - lPlr).Magnitude
  133.             if check < dist then
  134.                 targ = v
  135.                 dist = check
  136.             end
  137.         end
  138.     end
  139.     if targ then
  140.         game:GetService("Players").LocalPlayer.Character.Build.Work:FireServer(targ)
  141.     end
  142. end
  143. GPS:AddToggle("Construct Aura", false, function(s)
  144.     BuildAura = s
  145.     if BuildAura then
  146.         while wait(0.2) and BuildAura do
  147.             local buildChar = game.Players.LocalPlayer.Character
  148.             if buildChar then
  149.                 if buildChar:FindFirstChild("Build") then
  150.                     work()
  151.                 end
  152.             end
  153.         end
  154.     end
  155. end)
  156.  
  157. local Lag = false
  158. GPS:AddToggle("Lag Server", false, function(s)
  159.     Lag = s
  160.     while wait(1) and Lag do
  161.         for _,v in pairs(game:GetService("Players"):GetPlayers()) do
  162.             if v.Character then
  163.                 for s,y in pairs(v.Character:GetDescendants()) do
  164.                     pcall(function()
  165.                         game:GetService("ReplicatedStorage").VisualizeStar:FireServer(v.Character:FindFirstChild("Head"), true)
  166.                     end)
  167.                 end
  168.             end
  169.         end
  170.     end
  171. end)
  172.  
  173. GPS:AddLabel("This will lag you more")
  174. GPS:AddLabel("than it does others")
  175.  
  176.  
  177.  
  178.  
  179. local MiS = Main:CreateSector("Misc", "right")
  180. MiS:AddButton("Join Discord", function()
  181.     local request = request or http_request or (syn and syn.request)
  182.     if not request then return end
  183.     local start = 6463
  184.     local invCode = 'ceE7jGFgkg'
  185.     for i = start-10, start+1 do
  186.         spawn(function()
  187.             pcall(function()
  188.                 request({Url = "http://127.0.0.1:"..tostring(i).."/rpc?v=1",Method = "POST",Headers = {["Content-Type"] = "application/json",["Origin"] = "https://discord.com"},Body = game:GetService("HttpService"):JSONEncode({["cmd"] = "INVITE_BROWSER",["nonce"] = game:GetService("HttpService"):GenerateGUID(false),["args"] = {["invite"] = {["code"] = invCode,},["code"] = invCode}})})
  189.             end)
  190.         end)
  191.     end
  192. end)
  193.  
  194. MiS:AddButton("Copy Invite", function()
  195.     setclipboard("https://discord.gg/ceE7jGFgkg")
  196. end)
  197.  
  198. MiS:AddButton("ServerHop", function()
  199.     local x = {}
  200.     for _, v in ipairs(game:GetService("HttpService"):JSONDecode(game:HttpGetAsync("https://games.roblox.com/v1/games/" .. game.PlaceId .. "/servers/Public?sortOrder=Asc&limit=100")).data) do
  201.         if type(v) == "table" and v.maxPlayers > v.playing and v.id ~= game.JobId then
  202.             x[#x + 1] = v.id
  203.         end
  204.     end
  205.     if #x > 0 then
  206.         game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, x[math.random(1, #x)])
  207.     else
  208.         print("Serverhop failed")
  209.     end
  210. end)
  211.  
  212. MiS:AddButton("Rejoin", function()
  213.     game:GetService("TeleportService"):Teleport(game.PlaceId, game:GetService("Players").LocalPlayer)
  214. end)
  215.  
  216. MiS:AddButton("Fullbright", function()
  217.     loadstring(game:HttpGet("https://raw.githubusercontent.com/AnomalyRBLX/Database/main/External/fullbright.lua", true))()
  218. end)
  219.  
  220. MiS:AddKeybind("Toggle UI", Enum.KeyCode.RightShift, function(v) window.hidebutton = v end, function()end)
  221.  
  222.  
  223.  
  224.  
  225.  
  226. --//Silent Aim
  227. local function ClosestPlayerToMouse()
  228.     local target = nil
  229.     local dist = math.huge
  230.     for i,v in pairs(players:GetPlayers()) do
  231.         if v.Name ~= plr.Name then
  232.             if v.Character and v.Character:FindFirstChild("Humanoid") and v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") and v.TeamColor ~= plr.TeamColor then
  233.                 local screenpoint = camera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
  234.                 local check = (Vector2.new(mouse.X,mouse.Y)-Vector2.new(screenpoint.X,screenpoint.Y)).magnitude
  235.                 if check < dist then
  236.                     if SilentAim.FOV then
  237.                         if check <= SilentAim.FOVSize then
  238.                             target  = v
  239.                             dist = check
  240.                         end
  241.                     else
  242.                         target = v
  243.                         dist = check
  244.                     end
  245.                 end
  246.             end
  247.         end
  248.     end
  249.     return target
  250. end
  251.  
  252. local mt = getrawmetatable(game)
  253. local namecall = mt.__namecall
  254. setreadonly(mt,false)
  255.  
  256. local OldNamecall
  257. OldNamecall = hookmetamethod(game, "__namecall", function(self, ...)
  258.     local args = {...}
  259.     local method = getnamecallmethod()
  260.     if tostring(self) == "ShootEvent" and method == "FireServer" then
  261.         local player = ClosestPlayerToMouse()
  262.         if player and SilentAim.Enabled and SilentAim.Accuracy >= math.random(1,100) then
  263.             local targ
  264.             if SilentAim.Target == "Random" then
  265.                 targ = bodyParts[math.random(1,2)]
  266.             else
  267.                 targ = SilentAim.Target
  268.             end
  269.             args[5] = player.Character[targ]
  270.             args[6] = player.Character[targ].Position
  271.         end
  272.         return self.FireServer(self, unpack(args))
  273.     end
  274. return OldNamecall(self, ...)
  275. end)
  276.  
  277. game:GetService("RunService").Heartbeat:Connect(updateFOV)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement