local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local Humanoid = Character:WaitForChild("Humanoid") local LOCK_KEY = Enum.KeyCode.E --Target lock button local LOCK_PART = "HumanoidRootPart" -- fixate player part local SMOOTHNESS = 0 -- Smoothness of turning local MAX_DISTANCE = 150 -- maximum distance to player local BASE_PREDICTION = 1.10 -- Base prediction coefficient local MIN_PREDICTION = 0.15 -- Minimum coefficient local MAX_PREDICTION = 5.25 -- Maxium coefficient local BULLET_SPEED = 7000 -- bullet speed local PREDICTION_ADJUST_SPEED = 30 -- Adaptation speed prediction factor local RainbowColors = { Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 127, 0), Color3.fromRGB(255, 255, 0), Color3.fromRGB(0, 255, 0), Color3.fromRGB(0, 0, 255), Color3.fromRGB(75, 0, 130), Color3.fromRGB(148, 0, 211), Color3.fromRGB(255, 0, 151), } local Target = nil local Locked = false local Highlight local LastTargetPositions = {} local TargetSpeedHistory = {} local CurrentPrediction = BASE_PREDICTION local currentColorIndex = 1 local colorTransitionTime = 0.3 local lastColorChange = 0 local function ReloadScriptOnDeath() LocalPlayer.CharacterAdded:Connect(function(newChar) Character = newChar Humanoid = newChar:WaitForChild("Humanoid") Locked = false Target = nil if Highlight then Highlight:Destroy() Highlight = nil end end) end ReloadScriptOnDeath() local function UpdateRainbowHighlight(dt) if not Highlight then return end lastColorChange = lastColorChange + dt if lastColorChange >= colorTransitionTime then lastColorChange = 0 currentColorIndex = currentColorIndex % #RainbowColors + 1 local nextColorIndex = currentColorIndex % #RainbowColors + 1 local tweenInfo = TweenInfo.new( colorTransitionTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut ) local tween = TweenService:Create(Highlight, tweenInfo, { FillColor = RainbowColors[nextColorIndex], OutlineColor = RainbowColors[nextColorIndex] }) tween:Play() end end local function HighlightTarget(player) if Highlight then Highlight:Destroy() end if player and player.Character then Highlight = Instance.new("Highlight") Highlight.Adornee = player.Character Highlight.FillColor = RainbowColors[8] Highlight.OutlineColor = RainbowColors[8] Highlight.FillTransparency = 0.8 Highlight.Parent = player.Character lastColorChange = 0 currentColorIndex = 1 end end local function GetClosestPlayer() if not Character or not Character:FindFirstChild("HumanoidRootPart") then return nil end local closestPlayer = nil local shortestDistance = math.huge for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then local targetHRP = player.Character:FindFirstChild(LOCK_PART) if targetHRP then local distance = (Character.HumanoidRootPart.Position - targetHRP.Position).Magnitude if distance < shortestDistance and distance <= MAX_DISTANCE then shortestDistance = distance closestPlayer = player end end end end return closestPlayer end local function CalculateTargetSpeed(targetHRP) if not targetHRP then return 0 end local currentTime = tick() TargetSpeedHistory[targetHRP] = TargetSpeedHistory[targetHRP] or {} table.insert(TargetSpeedHistory[targetHRP], { time = currentTime, position = targetHRP.Position }) while #TargetSpeedHistory[targetHRP] > 5 do table.remove(TargetSpeedHistory[targetHRP], 1) end if #TargetSpeedHistory[targetHRP] >= 2 then local oldest = TargetSpeedHistory[targetHRP][1] local newest = TargetSpeedHistory[targetHRP][#TargetSpeedHistory[targetHRP]] local timeDiff = newest.time - oldest.time if timeDiff > 0 then local velocity = (newest.position - oldest.position) / timeDiff return velocity.Magnitude end end return 0 end local function AdjustPredictionFactor(targetSpeed) local normalizedSpeed = math.clamp(targetSpeed / 50, 0, 2) local targetPrediction = BASE_PREDICTION * (1 + normalizedSpeed * 1.5) CurrentPrediction = CurrentPrediction + (targetPrediction - CurrentPrediction) * PREDICTION_ADJUST_SPEED * RunService.Heartbeat:Wait() CurrentPrediction = math.clamp(CurrentPrediction, MIN_PREDICTION, MAX_PREDICTION) return CurrentPrediction end local function CalculatePredictedPosition(targetHRP) if not targetHRP then return targetHRP.Position end local currentTime = tick() LastTargetPositions[targetHRP] = LastTargetPositions[targetHRP] or {} table.insert(LastTargetPositions[targetHRP], { time = currentTime, position = targetHRP.Position }) while #LastTargetPositions[targetHRP] > 5 do table.remove(LastTargetPositions[targetHRP], 1) end if #LastTargetPositions[targetHRP] >= 2 then local oldest = LastTargetPositions[targetHRP][1] local newest = LastTargetPositions[targetHRP][#LastTargetPositions[targetHRP]] local timeDiff = newest.time - oldest.time if timeDiff > 0 then local velocity = (newest.position - oldest.position) / timeDiff local targetSpeed = velocity.Magnitude local dynamicPrediction = AdjustPredictionFactor(targetSpeed) local distance = (targetHRP.Position - Character.HumanoidRootPart.Position).Magnitude local timeToTarget = distance / BULLET_SPEED return targetHRP.Position + (velocity * timeToTarget * dynamicPrediction) end end return targetHRP.Position end local function SmoothLookAt(targetHRP) if not Character or not Character:FindFirstChild("HumanoidRootPart") then return end local predictedPosition = CalculatePredictedPosition(targetHRP) local hrp = Character.HumanoidRootPart local direction = (predictedPosition - hrp.Position).Unit local goalCFrame = CFrame.lookAt(hrp.Position, hrp.Position + Vector3.new(direction.X, 0, direction.Z)) if SMOOTHNESS >= 0 then hrp.CFrame = goalCFrame else hrp.CFrame = hrp.CFrame:Lerp(goalCFrame, 0 - SMOOTHNESS) end end UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == LOCK_KEY then Locked = not Locked Target = Locked and GetClosestPlayer() or nil HighlightTarget(Target) end end) local lastUpdate = tick() RunService.Heartbeat:Connect(function() local currentTime = tick() local deltaTime = currentTime - lastUpdate lastUpdate = currentTime if Highlight then UpdateRainbowHighlight(deltaTime) end if not Character or not Character:FindFirstChild("HumanoidRootPart") then return end if Target and Target.Character then local targetPart = Target.Character:FindFirstChild(LOCK_PART) if targetPart then SmoothLookAt(targetPart) end else Target = nil end end) if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then UserInputService.MouseBehavior = Enum.MouseBehavior.Default end local StarterGui = game:GetService("StarterGui") local function sendNotification(title, text, duration) StarterGui:SetCore("SendNotification", { Title = title or "Notify", Text = text or "do", Duration = duration or 30, Icon = "" }) end sendNotification("Xine Aimbot active!", "Approach the target and Press "..LOCK_KEY.Name.." to Lock/Unlock your target", 30) sendNotification("Script Version", "V 1.1 beta", 30)