Potato228

Flag Wars script

Jan 26th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.30 KB | Gaming | 0 0
  1. local Abstract = loadstring(game:HttpGet("https://raw.githubusercontent.com/AbstractPoo/Main/AbstractUI/AbstractUI"))()
  2. local UI = Abstract:Create("Flag Wars", UDim2.new(0, 420, 0, 450))
  3.  
  4. UI:Button("Silent Aim", "Click Once only !", function()
  5.     local currPlayer = game:GetService('Players').LocalPlayer
  6.     local servPlayer = game:GetService('Players')
  7.  
  8.     local RunService = game:GetService('RunService')
  9.     local servTeams = game:GetService("Teams")
  10.  
  11.     local currMouse = currPlayer:GetMouse()
  12.     local currCamera = game:GetService("Workspace").CurrentCamera
  13.  
  14.  
  15.     getgenv().GameSettings = {
  16.         SilentAim = {
  17.             ["active"] = true,
  18.             ["fov"] = 100,
  19.             ["hitpart"] = "Head",
  20.             ["circlevis"] = true,
  21.             ["wallbang"] = false,
  22.             ["circcolor"] = Color3.fromRGB(228, 9, 191)
  23.         }
  24.     }
  25.  
  26.  
  27.     local CircleInline = Drawing.new("Circle")
  28.     local CircleOutline = Drawing.new("Circle")
  29.     CircleInline.Radius = getgenv().GameSettings.SilentAim.fov
  30.     CircleInline.Thickness = 2
  31.     CircleInline.Position = Vector2.new(currCamera.ViewportSize.X / 2, currCamera.ViewportSize.Y / 2)
  32.     CircleInline.Transparency = 1
  33.     CircleInline.Color = getgenv().GameSettings.SilentAim.circcolor
  34.     CircleInline.Visible = getgenv().GameSettings.SilentAim.circlevis
  35.     CircleInline.ZIndex = 2
  36.     CircleOutline.Radius = getgenv().GameSettings.SilentAim.fov
  37.     CircleOutline.Thickness = 4
  38.     CircleOutline.Position = Vector2.new(currCamera.ViewportSize.X / 2, currCamera.ViewportSize.Y / 2)
  39.     CircleOutline.Transparency = 1
  40.     CircleOutline.Color = Color3.new()
  41.     CircleOutline.Visible = getgenv().GameSettings.SilentAim.circlevis
  42.     CircleOutline.ZIndex = 1
  43.  
  44.  
  45.     function isSameTeam(player)
  46.         if player.team ~= currPlayer.team and player.team ~= servTeams["Neutral"] then
  47.             return false
  48.         else
  49.             return true
  50.         end
  51.     end
  52.  
  53.     function isDead(player)
  54.         if
  55.             player == nil or player.Character == nil or player.Character:FindFirstChildWhichIsA("Humanoid") == nil or
  56.                 player.Character.Humanoid.Health <= 0
  57.         then
  58.             return true
  59.         else
  60.             return false
  61.         end
  62.     end
  63.  
  64.  
  65.         local function isClosestPlayer()
  66.             local target
  67.             local dist = math.huge
  68.             for _, v in next, servPlayer:GetPlayers() do
  69.                 if
  70.                     not isDead(v) and v ~= currPlayer and not isSameTeam(v) and v.Character:FindFirstChild("Head") and
  71.                         getgenv().GameSettings.SilentAim.active
  72.                 then
  73.                     local pos, visible = currCamera:WorldToScreenPoint(v.Character.HumanoidRootPart.Position)
  74.                     local magnitude = (Vector2.new(currMouse.X, currMouse.Y) - Vector2.new(pos.X, pos.Y)).magnitude
  75.                     if magnitude < (getgenv().GameSettings.SilentAim.fov) then
  76.                         if magnitude < dist then
  77.                             if getgenv().GameSettings.SilentAim.wallbang then
  78.                                 target = v
  79.                                 dist = magnitude
  80.                             else
  81.                                 if visible then
  82.                                     target = v
  83.                                     dist = magnitude
  84.                             end
  85.                         end
  86.    
  87.    
  88.                         end
  89.                     end
  90.                 end
  91.             end
  92.             return target
  93.         end
  94.    
  95.    
  96.         local target
  97.         local gmt = getrawmetatable(game)
  98.         setreadonly(gmt, false)
  99.         local oldNamecall = gmt.__namecall
  100.    
  101.         gmt.__namecall =
  102.             newcclosure(
  103.             function(self, ...)
  104.                 local Args = {...}
  105.                 local method = getnamecallmethod()
  106.                 if tostring(self) == "WeaponHit" and tostring(method) == "FireServer" then
  107.                     target = isClosestPlayer()
  108.                     if target then
  109.                         Args[2]["part"] = target.Character[getgenv().GameSettings.SilentAim.hitpart]
  110.                         return self.FireServer(self, unpack(Args))
  111.                     end
  112.                 end
  113.                 return oldNamecall(self, ...)
  114.             end
  115.         )
  116. end)
  117.  
  118. UI:Button("Trigger Bot", "Click Once only !", function()
  119.     local currPlayer = game:GetService('Players').LocalPlayer
  120.     local servPlayer = game:GetService('Players')
  121.     local currPlayerCharacter = currPlayer.Character or currPlayer.CharacterAdded:wait()
  122.     local currMouse = currPlayer:GetMouse()
  123.     local currCamera = game:GetService("Workspace").CurrentCamera
  124.  
  125.     local RunService = game:GetService("RunService")
  126.  
  127.  
  128.     function trigBot()
  129.         local ScreenPoint = currCamera:ScreenPointToRay(currMouse.X, currMouse.Y)
  130.         local Ray = Ray.new(ScreenPoint.Origin, ScreenPoint.Direction * 9999)
  131.         local Target, Position = workspace:FindPartOnRayWithIgnoreList(Ray, {currPlayerCharacter,workspace.CurrentCamera})
  132.         if Target and Position and servPlayer:GetPlayerFromCharacter(Target.Parent) and Target.Parent.Humanoid.Health > 0 or Target and Position and servPlayer:GetPlayerFromCharacter(Target.Parent.Parent) and Target.Parent.Parent.Humanoid.Health > 0 then
  133.             local currTarget = servPlayer:GetPlayerFromCharacter(Target.Parent) or servPlayer:GetPlayerFromCharacter(Target.Parent.Parent)
  134.             if currTarget.Team ~= currPlayer.Team and currTarget ~= currPlayer then
  135.                 mouse1click()
  136.             end
  137.         end
  138.     end
  139.  
  140.     RunService.Stepped:Connect(function()
  141.     trigBot()
  142.     end)
  143. end)
  144.  
  145. UI:Toggle("Kill All ( Sniper )", "Click Once only !", false, function(state)
  146.     local servPlayer = game:GetService("Players")
  147.     local currPlayer = game:GetService('Players').LocalPlayer
  148.    
  149.     function getEquippedWeapon(player)
  150.         local char = player.Character
  151.         local weapon = char and char:FindFirstChildWhichIsA("Tool")
  152.    
  153.         if weapon ~= nil then
  154.             return weapon.Name
  155.         else
  156.             return "Holstered"
  157.         end
  158.     end
  159.    
  160.     local currWeapon = getEquippedWeapon(currPlayer)
  161.    
  162.     for _, v in pairs(servPlayer:GetPlayers()) do
  163.         if v.Name ~= currPlayer.Name then
  164.             task.wait(1)
  165.     local args = {
  166.         [1] = game:GetService("Players").LocalPlayer.Character[currWeapon],
  167.         [2] = {
  168.             ["p"] = Vector3.new(127.24491882324219, 16.624034881591797, -84.08683776855469),
  169.             ["pid"] = 1,
  170.             ["part"] = v.Character.Head,
  171.             ["d"] = 80.71643829345703,
  172.             ["maxDist"] = 80.71429443359375,
  173.             ["h"] = v.Character.Humanoid,
  174.             ["m"] = Enum.Material.SmoothPlastic,
  175.             ["sid"] = 1,
  176.             ["t"] = 0.8510603182300679,
  177.             ["n"] = Vector3.new(-0.20354677736759186, -0.016248714178800583, 0.9789304733276367)
  178.         }
  179.     }
  180.    
  181.     if state == true then
  182.     game:GetService("ReplicatedStorage").WeaponsSystem.Network.WeaponHit:FireServer(unpack(args))
  183.     end
  184.     end
  185.     end
  186. end)
  187.  
  188. UI:Button("Hitbox Expander", "Click Once only !", function()
  189.     local currPlayer = game:GetService("Players").LocalPlayer
  190.     local servPlayer = game:GetService("Players")
  191.     local RunService = game:GetService("RunService")
  192.     local currTeams = game:GetService("Teams")
  193.    
  194.     getgenv().Hitbox = {
  195.         Settings = {
  196.             ['hitpart'] = 'Head',
  197.             ['hitsize'] = 5,
  198.             ['transparency'] = 0.60,
  199.             ['color'] =  BrickColor.new("Really blue")
  200.         }
  201.     }
  202.    
  203.     function isSameTeam(currTarget)
  204.         if currTarget.team ~= currPlayer.team and currTarget.team ~= currTeams["Neutral"] then
  205.             return false
  206.         else
  207.             return true
  208.         end
  209.     end
  210.    
  211.     function isDead(currTarget)
  212.         if
  213.             currTarget == nil or currTarget.Character == nil or
  214.                 currTarget.Character:FindFirstChildWhichIsA("Humanoid") == nil or
  215.                 currTarget.Character.Humanoid.Health <= 0
  216.          then
  217.             return true
  218.         else
  219.             return false
  220.         end
  221.     end
  222.    
  223.     RunService.Stepped:Connect(function()
  224.     for _, v in next, servPlayer:GetPlayers() do
  225.         if v ~= currPlayer and not isSameTeam(v) and not isDead(v) then
  226.    
  227.    
  228.            
  229.                     v.Character[getgenv().Hitbox.Settings.hitpart].Size = Vector3.new(getgenv().Hitbox.Settings.hitsize, getgenv().Hitbox.Settings.hitsize, getgenv().Hitbox.Settings.hitsize)
  230.                     v.Character[getgenv().Hitbox.Settings.hitpart].Transparency = getgenv().Hitbox.Settings.transparency
  231.                     v.Character[getgenv().Hitbox.Settings.hitpart].BrickColor = BrickColor.new("Really blue")
  232.                     v.Character[getgenv().Hitbox.Settings.hitpart].Material = "Neon"
  233.                     v.Character[getgenv().Hitbox.Settings.hitpart].CanCollide = false
  234.         end
  235.     end
  236.     end)
  237. end)
  238.  
  239. UI:Button("ESP", "Click Once only !", function()
  240.     local currPlayer = game:GetService("Players").LocalPlayer
  241.     local servPlayer = game:GetService("Players")
  242.     local RunService = game:GetService("RunService")
  243.     local teams = game:GetService("Teams")
  244.    
  245.    
  246.     local function numberRound(n)
  247.         return math.floor(tonumber(n) + 0.5)
  248.     end
  249.    
  250.     function isSameTeam(player)
  251.         if player.team ~= currPlayer.team and player.team ~= teams["Neutral"] then
  252.             return false
  253.         else
  254.             return true
  255.         end
  256.     end
  257.    
  258.     function isDead(player)
  259.         if
  260.             player == nil or player.Character == nil or player.Character:FindFirstChildWhichIsA("Humanoid") == nil or
  261.                 player.Character.Humanoid.Health <= 0
  262.          then
  263.             return true
  264.         else
  265.             return false
  266.         end
  267.     end
  268.    
  269.     function getEquippedWeapon(player)
  270.         local char = player.Character
  271.         local weapon = char and char:FindFirstChildWhichIsA("Tool")
  272.    
  273.         if weapon ~= nil then
  274.             return weapon.Name
  275.         else
  276.             return "Holstered"
  277.         end
  278.     end
  279.    
  280.     function doESP()
  281.         for _, v in next, servPlayer:GetPlayers() do
  282.             if v ~= currPlayer and not isSameTeam(v) and not isDead(v) then
  283.                 for _, k in next, v.Character:GetChildren() do
  284.                     if not isSameTeam(v) and not isDead(v) and k:IsA("BasePart") and not k:FindFirstChild("dohmESP") then
  285.                         local dohmESP = Instance.new("BoxHandleAdornment", k)
  286.                         dohmESP.Name = "dohmESP"
  287.                         dohmESP.AlwaysOnTop = true
  288.                         dohmESP.ZIndex = 10
  289.                         dohmESP.Size = k.Size
  290.                         dohmESP.Adornee = k
  291.                         dohmESP.Transparency = 0.7
  292.                         dohmESP.Color3 = Color3.new(1, 0, 0)
  293.                     end
  294.                     if not isDead(v) and not v.Character.Head:FindFirstChild("dohmESPTag") then
  295.                         local dohmESPTag = Instance.new("BillboardGui", v.Character.Head)
  296.                         dohmESPTag.Name = "dohmESPTag"
  297.                         dohmESPTag.Size = UDim2.new(1, 200, 1, 30)
  298.                         dohmESPTag.Adornee = v.Character.Head
  299.                         dohmESPTag.AlwaysOnTop = true
  300.    
  301.                         local topTag = Instance.new("TextLabel", dohmESPTag)
  302.                         topTag.TextWrapped = true
  303.                         topTag.Text =
  304.                             (v.Name ..
  305.                             " | " ..
  306.                                 numberRound((currPlayer.Character.Head.Position - v.Character.Head.Position).Magnitude / 3) ..
  307.                                     "m" .. " | " .. getEquippedWeapon(v))
  308.                         topTag.Size = UDim2.new(1, 0, 1, 0)
  309.                         topTag.TextYAlignment = "Top"
  310.                         topTag.TextColor3 = Color3.new(1, 1, 1)
  311.                         topTag.BackgroundTransparency = 1
  312.                     else
  313.                         v.Character.Head.dohmESPTag.TextLabel.Text =
  314.                             (v.Name ..
  315.                             " | " ..
  316.                                 numberRound((currPlayer.Character.Head.Position - v.Character.Head.Position).Magnitude / 3) ..
  317.                                     "m" .. " | " .. getEquippedWeapon(v))
  318.                     end
  319.                 end
  320.             end
  321.         end
  322.     end
  323.    
  324.     RunService.Stepped:Connect(function()
  325.     doESP()
  326.     end
  327.     )
  328. end)
  329.  
  330. UI:Button("Bring All ( Client Sided )", "Click Once only !", function()
  331.     local currPlayer = game:GetService("Players").LocalPlayer
  332.     local servPlayer = game:GetService("Players")
  333.    
  334.     local teams = game:GetService("Teams")
  335.    
  336.     function isSameTeam(player)
  337.         if player.team ~= currPlayer.team and player.team ~= teams["Neutral"] then
  338.             return false
  339.         else
  340.             return true
  341.         end
  342.     end
  343.    
  344.     while task.wait() do
  345.     for _, v in next, servPlayer:GetPlayers() do
  346.         if v ~= currPlayer and not isSameTeam(v) then
  347.             print(v)
  348.             v.Character.HumanoidRootPart.CFrame = currPlayer.Character.HumanoidRootPart.CFrame * CFrame.new(2.2,0.5,-6)
  349.         end
  350.     end
  351.     end
  352. end)
Add Comment
Please, Sign In to add comment