local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera -- ===================== -- RAYFIELD GUI SETUP -- ===================== local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Window = Rayfield:CreateWindow({ Name = "⚡ MADE BY: FLAME_YT277 ⚡", LoadingTitle = "MADE BY: FLAME_YT277 ⚡", LoadingSubtitle = "MADE BY: FLAME_YT277 | Ultra-fast targeting system", ConfigurationSaving = { Enabled = true, FolderName = "RobloxLockOn", FileName = "Settings" }, Discord = { Enabled = false, }, KeySystem = false }) -- ===================== -- SETTINGS STATE -- ===================== local settings = { -- Lock-On Settings lockEnabled = false, snapLock = true, lockDistance = 700, lockSmoothness = 0.01, ignoreTeammates = false, toggleKey = Enum.KeyCode.Q, fovEnabled = true, fovAngle = 90, -- ESP Settings espEnabled = false, espShowNames = true, espShowDistance = true, espShowHealth = true, espBoxes = true, espCrosshair = true, espMaxDistance = 700, espHealthBars = true, -- Visual Settings showTargetCircle = true, targetCircleColor = Color3.fromRGB(220, 50, 50) } local lockOnState = { currentTarget = nil, targetCircle = nil, espObjects = {}, fovCircle = nil } -- ===================== -- LOCK-ON TAB -- ===================== local LockOnTab = Window:CreateTab("🎯 Lock-On", 4483362458) LockOnTab:CreateLabel("⚡ MADE BY: FLAME_YT277 ⚡") LockOnTab:CreateDivider() local LockToggle = LockOnTab:CreateToggle({ Name = "Enable Lock-On", CurrentValue = false, Flag = "LockToggle", Callback = function(Value) settings.lockEnabled = Value if not Value then lockOnState.currentTarget = nil end end, }) local SnapLockToggle = LockOnTab:CreateToggle({ Name = "Snap Lock (INSTANT)", CurrentValue = true, Flag = "SnapLock", Callback = function(Value) settings.snapLock = Value end, }) local FOVToggle = LockOnTab:CreateToggle({ Name = "FOV Check", CurrentValue = true, Flag = "FOVCheck", Callback = function(Value) settings.fovEnabled = Value end, }) LockOnTab:CreateSlider({ Name = "FOV Angle", Range = {30, 180}, Increment = 5, Suffix = "°", CurrentValue = 90, Flag = "FOVAngle", Callback = function(Value) settings.fovAngle = Value end, }) LockOnTab:CreateSlider({ Name = "Lock Distance", Range = {25, 700}, Increment = 5, Suffix = " studs", CurrentValue = 100, Flag = "LockDistance", Callback = function(Value) settings.lockDistance = Value end, }) LockOnTab:CreateSlider({ Name = "Lock Smoothness", Range = {0.01, 0.5}, Increment = 0.02, Suffix = "", CurrentValue = 0.01, Flag = "LockSmoothness", Callback = function(Value) settings.lockSmoothness = Value end, }) local IgnoreTeammatesToggle = LockOnTab:CreateToggle({ Name = "Ignore Teammates", CurrentValue = false, Flag = "IgnoreTeammates", Callback = function(Value) settings.ignoreTeammates = Value end, }) LockOnTab:CreateKeybind({ Name = "Toggle Lock-On", CurrentKeybind = "Q", HoldToInteract = false, Flag = "ToggleKey", Callback = function(Keybind) settings.toggleKey = Keybind end, }) -- ===================== -- ESP TAB -- ===================== local ESPTab = Window:CreateTab("👁️ ESP", 6023366590) local ESPToggle = ESPTab:CreateToggle({ Name = "Enable ESP", CurrentValue = false, Flag = "ESPToggle", Callback = function(Value) settings.espEnabled = Value if not Value then for _, v in pairs(lockOnState.espObjects) do if v and v.Parent then pcall(function() v:Destroy() end) end end lockOnState.espObjects = {} end end, }) local ESPNamesToggle = ESPTab:CreateToggle({ Name = "Show Names", CurrentValue = true, Flag = "ESPNames", Callback = function(Value) settings.espShowNames = Value end, }) local ESPDistanceToggle = ESPTab:CreateToggle({ Name = "Show Distance", CurrentValue = true, Flag = "ESPDistance", Callback = function(Value) settings.espShowDistance = Value end, }) local ESPHealthToggle = ESPTab:CreateToggle({ Name = "Show Health", CurrentValue = true, Flag = "ESPHealth", Callback = function(Value) settings.espShowHealth = Value end, }) local ESPHealthBarsToggle = ESPTab:CreateToggle({ Name = "Health Bars", CurrentValue = true, Flag = "ESPHealthBars", Callback = function(Value) settings.espHealthBars = Value end, }) local ESPBoxesToggle = ESPTab:CreateToggle({ Name = "ESP Boxes", CurrentValue = true, Flag = "ESPBoxes", Callback = function(Value) settings.espBoxes = Value end, }) local ESPCrosshairToggle = ESPTab:CreateToggle({ Name = "Crosshairs", CurrentValue = true, Flag = "ESPCrosshair", Callback = function(Value) settings.espCrosshair = Value end, }) ESPTab:CreateSlider({ Name = "ESP Max Distance", Range = {50, 700}, Increment = 25, Suffix = " studs", CurrentValue = 200, Flag = "ESPMaxDistance", Callback = function(Value) settings.espMaxDistance = Value end, }) -- ===================== -- VISUALS TAB -- ===================== local VisualsTab = Window:CreateTab("✨ Visuals", 9191085848) local TargetCircleToggle = VisualsTab:CreateToggle({ Name = "Target Circle", CurrentValue = true, Flag = "TargetCircle", Callback = function(Value) settings.showTargetCircle = Value if not Value and lockOnState.targetCircle then lockOnState.targetCircle:Destroy() lockOnState.targetCircle = nil end end, }) VisualsTab:CreateLabel("Made by: FLAME_YT277") -- ===================== -- KEYBIND TOGGLE -- ===================== UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == settings.toggleKey then settings.lockEnabled = not settings.lockEnabled LockToggle:Set(settings.lockEnabled) end end) -- ===================== -- FOV CHECK FUNCTION -- ===================== local function isInFOV(targetPosition) if not settings.fovEnabled then return true end local character = player.Character if not character then return false end local rootPart = character:FindFirstChild("HumanoidRootPart") if not rootPart then return false end local cameraPos = camera.CFrame.Position local cameraForward = camera.CFrame.LookVector local directionToTarget = (targetPosition - cameraPos).Unit -- Calculate angle between camera forward and target local angle = math.acos(math.clamp(cameraForward:Dot(directionToTarget), -1, 1)) local angleInDegrees = math.deg(angle) return angleInDegrees <= (settings.fovAngle / 2) end -- ===================== -- VISIBILITY CHECK (RAYCAST) -- ===================== local function isHeadVisible(head) local character = player.Character if not character then return false end local rootPart = character:FindFirstChild("HumanoidRootPart") if not rootPart then return false end local origin = rootPart.Position local direction = (head.Position - origin) local rayParams = RaycastParams.new() rayParams.FilterDescendantsInstances = {character} rayParams.FilterType = Enum.RaycastFilterType.Exclude local result = workspace:Raycast(origin, direction, rayParams) if result then local hitInstance = result.Instance local hitCharacter = hitInstance:FindFirstAncestorOfClass("Model") if hitCharacter and hitCharacter:FindFirstChild("Humanoid") then return hitCharacter == head.Parent end return false end return true end -- ===================== -- FIND NEAREST VISIBLE TARGET (WITH FOV CHECK) -- ===================== local function getNearestVisibleTarget() local character = player.Character if not character then return nil end local rootPart = character:FindFirstChild("HumanoidRootPart") if not rootPart then return nil end local nearest = nil local nearestDist = settings.lockDistance for _, otherPlayer in ipairs(Players:GetPlayers()) do if otherPlayer == player then continue end local otherChar = otherPlayer.Character if not otherChar then continue end if settings.ignoreTeammates and otherPlayer.Team == player.Team then continue end local humanoid = otherChar:FindFirstChild("Humanoid") local head = otherChar:FindFirstChild("Head") if not humanoid or humanoid.Health <= 0 or not head then continue end -- FOV CHECK if not isInFOV(head.Position) then continue end local dist = (rootPart.Position - head.Position).Magnitude if dist < nearestDist and isHeadVisible(head) then nearest = head nearestDist = dist end end return nearest end -- ===================== -- TARGET CIRCLE (VISUAL FEEDBACK) -- ===================== local function createTargetCircle() if lockOnState.targetCircle then lockOnState.targetCircle:Destroy() end local circle = Instance.new("BillboardGui") circle.Size = UDim2.new(4, 0, 4, 0) circle.MaxDistance = settings.lockDistance * 1.5 circle.Adornee = lockOnState.currentTarget local frame = Instance.new("Frame") frame.Size = UDim2.new(1, 0, 1, 0) frame.BackgroundTransparency = 1 frame.Parent = circle local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(1, 0) corner.Parent = frame local stroke = Instance.new("UIStroke") stroke.Thickness = 2 stroke.Color = settings.targetCircleColor stroke.Parent = frame circle.Parent = workspace lockOnState.targetCircle = circle end -- ===================== -- IMPROVED ESP SYSTEM -- ===================== local function createESP(otherPlayer) local otherChar = otherPlayer.Character if not otherChar then return end local head = otherChar:FindFirstChild("Head") if not head then return end local espContainer = Instance.new("Folder") espContainer.Name = "ESP_" .. otherPlayer.UserId espContainer.Parent = workspace -- Main info billboard local espGui = Instance.new("BillboardGui") espGui.MaxDistance = settings.espMaxDistance espGui.Size = UDim2.new(5, 0, 6, 0) espGui.Adornee = head local mainFrame = Instance.new("Frame") mainFrame.BackgroundTransparency = 0.3 mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) mainFrame.Size = UDim2.new(1, 0, 1, 0) mainFrame.Parent = espGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = mainFrame local stroke = Instance.new("UIStroke") stroke.Thickness = 2 stroke.Color = Color3.fromRGB(0, 255, 0) stroke.Parent = mainFrame local textLabel = Instance.new("TextLabel") textLabel.BackgroundTransparency = 1 textLabel.TextColor3 = Color3.fromRGB(0, 255, 0) textLabel.TextSize = 13 textLabel.Font = Enum.Font.GothamBold textLabel.Size = UDim2.new(1, 0, 0.8, 0) textLabel.Position = UDim2.new(0, 0, 0, 0) textLabel.TextWrapped = true textLabel.Parent = mainFrame -- Health bar background local healthBarBg = Instance.new("Frame") healthBarBg.BackgroundColor3 = Color3.fromRGB(100, 0, 0) healthBarBg.Size = UDim2.new(1, 0, 0.2, 0) healthBarBg.Position = UDim2.new(0, 0, 0.8, 0) healthBarBg.Parent = mainFrame -- Health bar fill local healthBarFill = Instance.new("Frame") healthBarFill.BackgroundColor3 = Color3.fromRGB(0, 255, 0) healthBarFill.Size = UDim2.new(1, 0, 1, 0) healthBarFill.Parent = healthBarBg espGui.Parent = espContainer -- Crosshair (if enabled) local crosshairGui = Instance.new("BillboardGui") crosshairGui.MaxDistance = settings.espMaxDistance crosshairGui.Size = UDim2.new(2, 0, 2, 0) crosshairGui.Adornee = head local crossFrame = Instance.new("Frame") crossFrame.BackgroundTransparency = 1 crossFrame.Size = UDim2.new(1, 0, 1, 0) crossFrame.Parent = crosshairGui local crossH = Instance.new("Frame") crossH.BackgroundColor3 = Color3.fromRGB(0, 255, 0) crossH.Size = UDim2.new(0.6, 0, 0.1, 0) crossH.Position = UDim2.new(0.2, 0, 0.45, 0) crossH.Parent = crossFrame local crossV = Instance.new("Frame") crossV.BackgroundColor3 = Color3.fromRGB(0, 255, 0) crossV.Size = UDim2.new(0.1, 0, 0.6, 0) crossV.Position = UDim2.new(0.45, 0, 0.2, 0) crossV.Parent = crossFrame crosshairGui.Parent = espContainer -- Store ESP data lockOnState.espObjects[otherPlayer.UserId] = { container = espContainer, mainGui = espGui, textLabel = textLabel, healthBarFill = healthBarFill, crosshairGui = crosshairGui, humanoid = otherChar:FindFirstChild("Humanoid") } -- Cleanup when humanoid dies local humanoid = otherChar:FindFirstChild("Humanoid") if humanoid then humanoid.HealthChanged:Connect(function() if humanoid.Health <= 0 then if lockOnState.espObjects[otherPlayer.UserId] then lockOnState.espObjects[otherPlayer.UserId].container:Destroy() lockOnState.espObjects[otherPlayer.UserId] = nil end end end) end end -- ===================== -- MAIN LOOP - ULTRA OPTIMIZED -- ===================== RunService.RenderStepped:Connect(function() local character = player.Character if not character then return end local rootPart = character:FindFirstChild("HumanoidRootPart") if not rootPart then return end -- ========== LOCK-ON ========== if settings.lockEnabled then lockOnState.currentTarget = getNearestVisibleTarget() if lockOnState.currentTarget then if settings.snapLock then camera.CFrame = CFrame.lookAt(camera.CFrame.Position, lockOnState.currentTarget.Position) else local currentCFrame = camera.CFrame local lookAt = CFrame.lookAt(currentCFrame.Position, lockOnState.currentTarget.Position) camera.CFrame = currentCFrame:Lerp(lookAt, settings.lockSmoothness) end end -- Update target circle if settings.showTargetCircle then if lockOnState.currentTarget then if not lockOnState.targetCircle then createTargetCircle() else lockOnState.targetCircle.Adornee = lockOnState.currentTarget end else if lockOnState.targetCircle then lockOnState.targetCircle:Destroy() lockOnState.targetCircle = nil end end end end -- ========== ESP ========== if settings.espEnabled then for _, otherPlayer in ipairs(Players:GetPlayers()) do if otherPlayer == player then continue end local otherChar = otherPlayer.Character if not otherChar or not otherChar:FindFirstChild("Humanoid") then continue end local humanoid = otherChar.Humanoid if humanoid.Health <= 0 then continue end local head = otherChar:FindFirstChild("Head") if not head then continue end -- Create ESP if doesn't exist if not lockOnState.espObjects[otherPlayer.UserId] then createESP(otherPlayer) else -- Update ESP data local espData = lockOnState.espObjects[otherPlayer.UserId] if espData and espData.container.Parent then local distance = (rootPart.Position - head.Position).Magnitude -- Update text local espText = "" if settings.espShowNames then espText = espText .. otherPlayer.Name .. "\n" end if settings.espShowDistance then espText = espText .. string.format("%.1f studs", distance) end espData.textLabel.Text = espText -- Update health bar if settings.espHealthBars and espData.humanoid then local healthPercent = math.clamp(espData.humanoid.Health / espData.humanoid.MaxHealth, 0, 1) espData.healthBarFill.Size = UDim2.new(healthPercent, 0, 1, 0) -- Color gradient if healthPercent > 0.5 then espData.healthBarFill.BackgroundColor3 = Color3.fromRGB(0, 255, 0) elseif healthPercent > 0.25 then espData.healthBarFill.BackgroundColor3 = Color3.fromRGB(255, 255, 0) else espData.healthBarFill.BackgroundColor3 = Color3.fromRGB(255, 0, 0) end end -- Toggle crosshair visibility espData.crosshairGui.Enabled = settings.espCrosshair end end end end end) -- ===================== -- CLEANUP -- ===================== player.CharacterAdded:Connect(function() if lockOnState.targetCircle then lockOnState.targetCircle:Destroy() lockOnState.targetCircle = nil end lockOnState.currentTarget = nil for _, v in pairs(lockOnState.espObjects) do if v and v.container and v.container.Parent then v.container:Destroy() end end lockOnState.espObjects = {} end) Players.PlayerRemoving:Connect(function(leavingPlayer) if lockOnState.espObjects[leavingPlayer.UserId] then if lockOnState.espObjects[leavingPlayer.UserId].container then lockOnState.espObjects[leavingPlayer.UserId].container:Destroy() end lockOnState.espObjects[leavingPlayer.UserId] = nil end end) Rayfield:LoadConfiguration()