if getgenv()._MB_LOADED then return end getgenv()._MB_LOADED = true local Fluent = loadstring(game:HttpGet("https://github.com/dawid-scripts/Fluent/releases/latest/download/main.lua"))() local SaveManager = loadstring(game:HttpGet("https://raw.githubusercontent.com/dawid-scripts/Fluent/master/Addons/SaveManager.lua"))() local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local camera = workspace.CurrentCamera local ShootEvent = ReplicatedStorage:WaitForChild("GunRemotes"):WaitForChild("ShootEvent") local currentTarget = nil local FOVCircle = Drawing.new("Circle") FOVCircle.Thickness = 2 FOVCircle.Color = Color3.fromRGB(0, 255, 140) FOVCircle.Transparency = 0.6 FOVCircle.Filled = false FOVCircle.Radius = 0 FOVCircle.Visible = false local Window = Fluent:CreateWindow({ Title = "Magic Bullet", SubTitle = "Prison Life", TabWidth = 160, Size = UDim2.fromOffset(580, 400), Acrylic = false, Theme = "Dark", MinimizeKey = Enum.KeyCode.RightShift }) local Tabs = { Main = Window:AddTab({ Title = "Main", Icon = "crosshair" }), Settings = Window:AddTab({ Title = "Settings", Icon = "settings" }), Keybinds = Window:AddTab({ Title = "Keybinds", Icon = "keyboard" }), } local Options = Fluent.Options Tabs.Main:AddToggle("MagicBullet", { Title = "Magic Bullet", Default = false }) Tabs.Main:AddSlider("FOV", { Title = "FOV", Description = "Detection radius (lower = more legit)", Default = 80, Min = 20, Max = 120, Rounding = 0 }) Tabs.Main:AddSlider("MaxDistance", { Title = "Max Distance", Description = "Maximum target distance in studs", Default = 400, Min = 50, Max = 1000, Rounding = 0 }) Tabs.Main:AddDropdown("TargetPart", { Title = "Target Part", Values = { "Head", "UpperTorso", "Closest" }, Multi = false, Default = 1 }) Tabs.Main:AddDropdown("Priority", { Title = "Priority", Description = "How to select the target", Values = { "Crosshair", "Distance", "Health" }, Multi = false, Default = 1 }) Tabs.Main:AddToggle("WallCheck", { Title = "Wall Check", Description = "Don't target players behind walls", Default = true }) Tabs.Main:AddToggle("TeamCheck", { Title = "Team Check", Description = "Guards -> Inmates/Criminals, Inmates/Criminals -> Guards", Default = true }) Tabs.Settings:AddToggle("ShowFOV", { Title = "Show FOV Circle", Default = true }) Tabs.Settings:AddToggle("ShowHighlight", { Title = "Target Highlight", Default = true }) Tabs.Settings:AddSlider("HighlightTransparency", { Title = "Highlight Transparency", Default = 0.55, Min = 0, Max = 1, Rounding = 2 }) Tabs.Settings:AddColorpicker("HighlightFillColor", { Title = "Highlight Fill Color", Default = Color3.fromRGB(255, 40, 120) }) Tabs.Settings:AddColorpicker("HighlightOutlineColor", { Title = "Highlight Outline Color", Default = Color3.fromRGB(0, 255, 255) }) Tabs.Settings:AddColorpicker("FOVCircleColor", { Title = "FOV Circle Color", Default = Color3.fromRGB(0, 255, 140) }) Tabs.Keybinds:AddKeybind("ToggleKey", { Title = "Toggle Magic Bullet", Mode = "Toggle", Default = "None", Callback = function() Options.MagicBullet:SetValue(not Options.MagicBullet.Value) end }) Tabs.Keybinds:AddParagraph({ Title = "Toggle UI", Content = "Press RightShift to show/hide the UI window" }) SaveManager:SetLibrary(Fluent) SaveManager:IgnoreThemeSettings() SaveManager:SetFolder("MagicBullet") SaveManager:SetFolder("MagicBullet/PrisonLife") SaveManager:BuildConfigSection(Tabs.Settings) Window:SelectTab(1) Fluent:Notify({ Title = "Magic Bullet", Content = "Script loaded successfully!", Duration = 5 }) local function isEnemy(targetPlayer) if not Options.TeamCheck.Value then return targetPlayer ~= player end if not targetPlayer or not targetPlayer.Team then return false end local myTeam = player.Team and player.Team.Name or "" local theirTeam = targetPlayer.Team.Name if myTeam == "Guards" then return theirTeam == "Inmates" or theirTeam == "Criminals" else return theirTeam == "Guards" end end local function isWallBetween(origin, targetPos) if not Options.WallCheck.Value then return false end local direction = targetPos - origin local distance = direction.Magnitude local rayParams = RaycastParams.new() rayParams.FilterDescendantsInstances = {player.Character} rayParams.FilterType = Enum.RaycastFilterType.Exclude local result = workspace:Raycast(origin, direction.Unit * distance, rayParams) if result then if result.Instance and result.Instance.Parent then local model = result.Instance:FindFirstAncestorOfClass("Model") if model and Players:GetPlayerFromCharacter(model) then return false end end return true end return false end local function getTarget() if not Options.MagicBullet.Value then return nil end local myRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart") local myHead = player.Character and player.Character:FindFirstChild("Head") if not myRoot or not myHead then return nil end local fovVal = Options.FOV.Value local maxDist = Options.MaxDistance.Value local targetPart = Options.TargetPart.Value local priority = Options.Priority.Value local center = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2) local radius = (fovVal / 2.2) * (camera.ViewportSize.X / 200) local bestTarget = nil local bestScore = math.huge for _, p in ipairs(Players:GetPlayers()) do if p ~= player and p.Character and isEnemy(p) then local hum = p.Character:FindFirstChild("Humanoid") if hum and hum.Health > 0 then local parts = {} if targetPart == "Closest" then for _, name in ipairs({"Head", "UpperTorso", "LowerTorso", "HumanoidRootPart"}) do local part = p.Character:FindFirstChild(name) if part then table.insert(parts, part) end end else local part = p.Character:FindFirstChild(targetPart) if part then table.insert(parts, part) end end for _, part in ipairs(parts) do local screenPos, onScreen = camera:WorldToViewportPoint(part.Position) if onScreen then local distFromCenter = (Vector2.new(screenPos.X, screenPos.Y) - center).Magnitude local dist3D = (myRoot.Position - part.Position).Magnitude if distFromCenter <= radius and dist3D <= maxDist then if not isWallBetween(myHead.Position, part.Position) then local score if priority == "Crosshair" then score = distFromCenter elseif priority == "Distance" then score = dist3D elseif priority == "Health" then score = hum.Health end if score < bestScore then bestScore = score bestTarget = part end end end end end end end end if bestTarget and targetPart ~= "Closest" then local preferred = bestTarget.Parent:FindFirstChild(targetPart) if preferred then bestTarget = preferred end end return bestTarget end local oldNamecall oldNamecall = hookmetamethod(game, "__namecall", newcclosure(function(self, ...) local method = getnamecallmethod() local args = {...} if Options.MagicBullet.Value and self == ShootEvent and method == "FireServer" and currentTarget then if typeof(args[1]) == "table" and typeof(args[1][1]) == "table" then local packet = args[1] packet[1][2] = currentTarget.Position + Vector3.new(0, 0.1, 0) packet[1][3] = currentTarget end end return oldNamecall(self, ...) end)) local function applyHighlight(character, enabled) if not Options.ShowHighlight.Value then local h = character and character:FindFirstChild("MBHighlight") if h then h:Destroy() end return end if not character then return end if enabled then local h = character:FindFirstChild("MBHighlight") or Instance.new("Highlight") h.Name = "MBHighlight" h.FillColor = Options.HighlightFillColor.Value h.OutlineColor = Options.HighlightOutlineColor.Value h.FillTransparency = Options.HighlightTransparency.Value h.OutlineTransparency = 0.1 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.Parent = character else local h = character:FindFirstChild("MBHighlight") if h then h:Destroy() end end end RunService.RenderStepped:Connect(function() local fovVal = Options.FOV.Value FOVCircle.Position = Vector2.new(camera.ViewportSize.X / 2, camera.ViewportSize.Y / 2) FOVCircle.Radius = (fovVal / 2.2) * (camera.ViewportSize.X / 200) FOVCircle.Color = Options.FOVCircleColor.Value FOVCircle.Visible = Options.MagicBullet.Value and Options.ShowFOV.Value currentTarget = getTarget() for _, p in ipairs(Players:GetPlayers()) do if p.Character then local isTarget = currentTarget and currentTarget.Parent == p.Character applyHighlight(p.Character, isTarget and isEnemy(p)) end end end) SaveManager:LoadAutoloadConfig()