local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
-- DEVICE CHECK
local isMobile = UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled
-- SETTINGS (BASE)
local AIM_FOV = isMobile and 180 or 170
local BASE_SMOOTHNESS = isMobile and 0.25 or 0.28
-- EXTRA PC BOOST (subtle)
local PC_BOOST = isMobile and 1 or 1.15
-- STATE
local ENABLED = true -- ✅ now ON by default for ALL
local CURRENT_TARGET = nil
-- GUI
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "AimAssistGUI"
screenGui.Parent = player:WaitForChild("PlayerGui")
local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(0, 160, 0, 40)
toggleButton.Position = UDim2.new(0, 20, 0, 200)
toggleButton.BackgroundColor3 = Color3.fromRGB(0, 120, 255)
toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
toggleButton.Parent = screenGui
-- TEXT SETUP
if isMobile then
toggleButton.Text = "Aim Assist: ON (Mobile)"
else
toggleButton.Text = "Aim Assist: ON (PC)"
end
-- TOGGLE (PC ONLY)
toggleButton.MouseButton1Click:Connect(function()
if isMobile then return end
ENABLED = not ENABLED
toggleButton.Text = ENABLED and "Aim Assist: ON (PC)" or "Aim Assist: OFF (PC)"
end)
-- WALL CHECK
local function isVisible(targetPart)
local origin = camera.CFrame.Position
local direction = (targetPart.Position - origin)
local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
rayParams.FilterDescendantsInstances = {player.Character}
local result = workspace:Raycast(origin, direction, rayParams)
if result then
return result.Instance:IsDescendantOf(targetPart.Parent)
end
return true
end
-- DYNAMIC SMOOTHNESS
local function getDynamicSmoothness(distance)
return math.clamp(BASE_SMOOTHNESS - (distance / 1000), 0.08, BASE_SMOOTHNESS)
end
-- DISTANCE FACTOR
local function getDistanceFactor(target)
local dist = (camera.CFrame.Position - target.Position).Magnitude
return math.clamp(1 - (dist / 200), 0.4, 1)
end
-- GET TARGET
local function getClosestTarget()
local closest = nil
local shortestDistance = AIM_FOV
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= player and plr.Character then
local char = plr.Character
local head = char:FindFirstChild("Head")
local humanoid = char:FindFirstChild("Humanoid")
if head and humanoid and humanoid.Health > 0 then
-- TEAM CHECK
if player.Team and plr.Team == player.Team then
continue
end
local screenPoint, onScreen = camera:WorldToViewportPoint(head.Position)
if onScreen then
local mousePos = UserInputService:GetMouseLocation()
local dist = (Vector2.new(screenPoint.X, screenPoint.Y) - mousePos).Magnitude
if dist < shortestDistance then
if isVisible(head) then
shortestDistance = dist
closest = head
end
end
end
end
end
end
return closest
end
-- AIM LOOP
RunService.RenderStepped:Connect(function()
if not ENABLED then return end
local target = getClosestTarget()
-- STICKY AIM
if target then
CURRENT_TARGET = target
elseif CURRENT_TARGET and isVisible(CURRENT_TARGET) then
target = CURRENT_TARGET
else
CURRENT_TARGET = nil
end
if target then
local camPos = camera.CFrame.Position
local goal = CFrame.new(camPos, target.Position)
local screenPoint = camera:WorldToViewportPoint(target.Position)
local mousePos = UserInputService:GetMouseLocation()
local dist = (Vector2.new(screenPoint.X, screenPoint.Y) - mousePos).Magnitude
local dynamicSmooth = getDynamicSmoothness(dist)
local distanceFactor = getDistanceFactor(target)
-- ✅ FINAL STRENGTH (with PC boost)
local finalStrength = dynamicSmooth * distanceFactor * PC_BOOST
camera.CFrame = camera.CFrame:Lerp(goal, finalStrength)
end
end)
Comments
Please leave a comment if you're having trouble or just want to criticize me of my poor grammar lol