--optimization and variables local game = game local players = game:GetService("Players") local player = players.LocalPlayer local teams = game:GetService("Teams"); local rs = game:GetService("RunService") local camera = workspace.CurrentCamera local vector2 = Vector2.new local enum = Enum.KeyCode local silentaim = false local silentkeybindtoggle = false local silentkeybind = false local noforcefields = false local weapons = {} for _,v in pairs(game:GetService("ReplicatedStorage").Weapons:GetChildren()) do table.insert(weapons,v.Name) end local camos = {} for _,v in pairs(game:GetService("ReplicatedStorage").Camos:GetChildren()) do table.insert(camos,v.Name) end local primary local secondary local primarycamo local secondarycamo --- --- functions local s=player.PlayerScripts.Vortex.Modifiers.Steadiness local m=player.PlayerScripts.Vortex.Modifiers.Mobility local function r() if s and s.Value>0 then s.Value=0 end if m and m.Value>0 then m.Value=0 end end if s then s.Changed:Connect(r) end if m then m.Changed:Connect(r) end r() local get_closest_player = function() local closest = nil local closest_distance = math.huge for _, character in workspace.GetChildren(workspace) do local player = players.FindFirstChild(players, character.Name) local root_part = character.FindFirstChild(character, "HumanoidRootPart") if (not player) or (not root_part) then continue end if (character.Humanoid.Health <= 0) then continue end local team_attribute = player.GetAttribute(player, "Team") if (not team_attribute) then continue end if (teams[team_attribute] == players.LocalPlayer.Team) then continue end local position, on_screen = camera.WorldToViewportPoint(camera, root_part.Position) if (not on_screen) then continue end local center = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2) local distance = (Vector2.new(position.X, position.Y) - center).Magnitude if (closest_distance > distance) then closest = character closest_distance = distance end end return closest end local events = { ["ShootEvent"] = function(arg) return (typeof(arg) == "Instance" and arg.Name and (string.find(arg.Name, players.LocalPlayer.Name))) end, } local old_namecall old_namecall = hookmetamethod(game, "__namecall", function(self, caller, message, ...) local method = getnamecallmethod() if (method == "Fire" and self.Name == "Sync") then for event, identify in events do if (event == "ShootEvent" and identify(message)) then local closest_player = get_closest_player() local ammo, cframe, id, weapon, projectile = ... if (closest_player and closest_player.FindFirstChild(closest_player, "Head")) and silentaim then if silentkeybindtoggle then if silentkeybind then cframe = closest_player.Head.CFrame end else cframe = closest_player.Head.CFrame end end return old_namecall(self, caller, message, ammo, cframe, id, weapon, projectile, ...) end end end return old_namecall(self, caller, message, ...) end) rs.RenderStepped:Connect(function() if noforcefields then for _,v in pairs(game:GetService("Workspace").Env:GetChildren()) do if string.find(v.Name, "Forcefield") then if v.FullSphere.Color ~= Color3.fromRGB(0, 102, 255) then v:Destroy() end end end end end) --- --- ui local OrionLib = loadstring(game:HttpGet(('https://raw.githubusercontent.com/jensonhirst/Orion/main/source')))() OrionLib:MakeNotification({ Name = "GunFight Arena", Content = "", Image = "rbxassetid://4483345998", Time = 5 }) local Window = OrionLib:MakeWindow({Name = "Gunfight arena", HidePremium = false, SaveConfig = false, ConfigFolder = "gunfight arena"}) local aimtab = Window:MakeTab({ Name = "Aim", Icon = "rbxassetid://4483345998", PremiumOnly = false }) local weapontab = Window:MakeTab({ Name = "weapons", Icon = "rbxassetid://4483345998", PremiumOnly = false }) local aimsection = aimtab:AddSection({ Name = "SilentAim" }) aimsection:AddToggle({ Name = "Silent Aim (credit to dementia)", Default = false, Callback = function(Value) silentaim = Value end }) aimsection:AddToggle({ Name = "SilentAim keybind toggle", Default = false, Callback = function(Value) silentkeybindtoggle = Value end }) aimsection:AddBind({ Name = "silent aim keybind", Default = enum.E, Hold = false, Callback = function() if silentkeybindtoggle then silentkeybind = not silentkeybind end end }) local miscsection = aimtab:AddSection({ Name = "Misc" }) miscsection:AddToggle({ Name = "no enemy forcefields", Default = false, Callback = function(Value) noforcefields = Value end }) local primarySection = weapontab:AddSection({ Name = "primary weapon changer" }) local primaryDropdown = primarySection:AddDropdown({ Name = "gun selector", Default = weapons[1], Options = weapons, Callback = function(Value) primary = Value end, }) local primarybutton = primarySection:AddButton({ Name = "equip gun", Callback = function() player:SetAttribute("Primary",primary) end, }) local primarySection2 = weapontab:AddSection({ Name = "primary weapon camo changer" }) local primaryDropdown2 = primarySection2:AddDropdown({ Name = "camo selector", Default = camos[1], Options = camos, Callback = function(Value) primarycamo = Value end, }) local primarybutton2 = primarySection2:AddButton({ Name = "equip camo", Callback = function() player:SetAttribute("PrimaryCamo",primarycamo) end, }) local secondarySection = weapontab:AddSection({ Name = "Secondary weapon changer" }) local secondarydropdown = secondarySection:AddDropdown({ Name = "gun selector", Default = weapons[1], Options = weapons, Callback = function(Value) secondary = Value end, }) local secondarybutton = secondarySection:AddButton({ Name = "equip gun", Callback = function() player:SetAttribute("Secondary",secondary) end, }) local secondarySection2 = weapontab:AddSection({ Name = "Secondary weapon camo changer" }) local secondarydropdown2 = secondarySection2:AddDropdown({ Name = "camo selector", Default = camos[1], Options = camos, Callback = function(Value) secondarycamo = Value end, }) local secondarybutton2 = secondarySection2:AddButton({ Name = "equip camo", Callback = function() player:SetAttribute("SecondaryCamo",secondarycamo) end, }) local SettingsTab = Window:MakeTab({ Name = "Settings", Icon = "rbxassetid://4483345998", PremiumOnly = false }) local SettingsSection = SettingsTab:AddSection({ Name = "Settings" }) SettingsSection:AddButton({ Name = "Destroy UI", Callback = function() OrionLib:Destroy() end }) OrionLib:Init() ---