-- PRIVATE ROBLOX STUDIO AIM CONTROL
--========================================================-- LocalScript
-- StarterPlayer > StarterPlayerScripts
--========================================================
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
--========================================================
-- SETTINGS
--========================================================
local Settings = {
AimEnabled = false,
-- Aim settings
FOV = 150,
Smoothness = 0.15,
AimKey = Enum.KeyCode.Q,
-- Target settings
TargetPart = "Head",
TeamCheck = true,
-- New:
-- Camera tracking speed is multiplied by
-- the local player's WalkSpeed.
UsePlayerSpeed = true,
}
local WaitingForKey = false
--========================================================
-- GUI
--========================================================
local Gui = Instance.new("ScreenGui")
Gui.Name = "PrivateAimControl"
Gui.ResetOnSpawn = false
Gui.IgnoreGuiInset = true
Gui.Parent = PlayerGui
--========================================================
-- MAIN WINDOW
--========================================================
local Main = Instance.new("Frame")
Main.Name = "Main"
Main.Size = UDim2.fromOffset(350, 420)
Main.Position = UDim2.new(0.5, -175, 0.5, -210)
Main.BackgroundColor3 = Color3.fromRGB(17, 17, 23)
Main.BorderSizePixel = 0
Main.Parent = Gui
local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 14)
MainCorner.Parent = Main
local MainStroke = Instance.new("UIStroke")
MainStroke.Color = Color3.fromRGB(55, 55, 70)
MainStroke.Thickness = 1
MainStroke.Parent = Main
--========================================================
-- TOP BAR
--========================================================
local TopBar = Instance.new("Frame")
TopBar.Size = UDim2.new(1, 0, 0, 58)
TopBar.BackgroundColor3 = Color3.fromRGB(24, 24, 32)
TopBar.BorderSizePixel = 0
TopBar.Parent = Main
local TopCorner = Instance.new("UICorner")
TopCorner.CornerRadius = UDim.new(0, 14)
TopCorner.Parent = TopBar
local Title = Instance.new("TextLabel")
Title.BackgroundTransparency = 1
Title.Position = UDim2.fromOffset(18, 8)
Title.Size = UDim2.new(1, -80, 0, 22)
Title.Text = "AIM CONTROL"
Title.TextColor3 = Color3.fromRGB(240, 240, 248)
Title.TextSize = 16
Title.Font = Enum.Font.GothamBold
Title.TextXAlignment = Enum.TextXAlignment.Left
Title.Parent = TopBar
local Subtitle = Instance.new("TextLabel")
Subtitle.BackgroundTransparency = 1
Subtitle.Position = UDim2.fromOffset(18, 30)
Subtitle.Size = UDim2.new(1, -80, 0, 16)
Subtitle.Text = "Private testing environment"
Subtitle.TextColor3 = Color3.fromRGB(120, 120, 135)
Subtitle.TextSize = 10
Subtitle.Font = Enum.Font.Gotham
Subtitle.TextXAlignment = Enum.TextXAlignment.Left
Subtitle.Parent = TopBar
local Close = Instance.new("TextButton")
Close.Size = UDim2.fromOffset(34, 34)
Close.Position = UDim2.new(1, -44, 0, 12)
Close.BackgroundColor3 = Color3.fromRGB(38, 38, 48)
Close.Text = "×"
Close.TextColor3 = Color3.fromRGB(230, 230, 240)
Close.TextSize = 20
Close.Font = Enum.Font.GothamBold
Close.AutoButtonColor = false
Close.Parent = TopBar
local CloseCorner = Instance.new("UICorner")
CloseCorner.CornerRadius = UDim.new(0, 9)
CloseCorner.Parent = Close
--========================================================
-- UI HELPERS
--========================================================
local function Label(text, y)
local label = Instance.new("TextLabel")
label.BackgroundTransparency = 1
label.Position = UDim2.fromOffset(20, y)
label.Size = UDim2.fromOffset(200, 22)
label.Text = text
label.TextColor3 = Color3.fromRGB(195, 195, 208)
label.TextSize = 12
label.Font = Enum.Font.GothamMedium
label.TextXAlignment = Enum.TextXAlignment.Left
label.Parent = Main
return label
end
local function Button(text, x, y, width, height)
local button = Instance.new("TextButton")
button.Size = UDim2.fromOffset(width, height)
button.Position = UDim2.fromOffset(x, y)
button.BackgroundColor3 = Color3.fromRGB(32, 32, 42)
button.BorderSizePixel = 0
button.Text = text
button.TextColor3 = Color3.fromRGB(225, 225, 235)
button.TextSize = 12
button.Font = Enum.Font.GothamMedium
button.AutoButtonColor = false
button.Parent = Main
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 8)
corner.Parent = button
return button
end
--========================================================
-- AIM TOGGLE
--========================================================
Label("Target Lock", 78)
local AimToggle = Button(
"OFF",
255,
74,
70,
30
)
local function UpdateAimButton()
if Settings.AimEnabled then
AimToggle.Text = "ON"
AimToggle.BackgroundColor3 = Color3.fromRGB(65, 135, 255)
else
AimToggle.Text = "OFF"
AimToggle.BackgroundColor3 = Color3.fromRGB(32, 32, 42)
end
end
AimToggle.MouseButton1Click:Connect(function()
Settings.AimEnabled = not Settings.AimEnabled
UpdateAimButton()
end)
--========================================================
-- FOV SLIDER
--========================================================
Label("FOV", 125)
local FOVValue = Instance.new("TextLabel")
FOVValue.BackgroundTransparency = 1
FOVValue.Position = UDim2.fromOffset(275, 121)
FOVValue.Size = UDim2.fromOffset(45, 22)
FOVValue.Text = tostring(Settings.FOV)
FOVValue.TextColor3 = Color3.fromRGB(100, 165, 255)
FOVValue.TextSize = 12
FOVValue.Font = Enum.Font.GothamBold
FOVValue.Parent = Main
local FOVBar = Instance.new("Frame")
FOVBar.Size = UDim2.fromOffset(235, 6)
FOVBar.Position = UDim2.fromOffset(20, 153)
FOVBar.BackgroundColor3 = Color3.fromRGB(43, 43, 54)
FOVBar.BorderSizePixel = 0
FOVBar.Parent = Main
local FOVFill = Instance.new("Frame")
FOVFill.Size = UDim2.new(
(Settings.FOV - 50) / 350,
0,
1,
0
)
FOVFill.BackgroundColor3 = Color3.fromRGB(75, 140, 255)
FOVFill.BorderSizePixel = 0
FOVFill.Parent = FOVBar
local FOVKnob = Instance.new("Frame")
FOVKnob.Size = UDim2.fromOffset(14, 14)
FOVKnob.AnchorPoint = Vector2.new(0.5, 0.5)
FOVKnob.Position = UDim2.new(
(Settings.FOV - 50) / 350,
0,
0.5,
0
)
FOVKnob.BackgroundColor3 = Color3.fromRGB(240, 240, 245)
FOVKnob.BorderSizePixel = 0
FOVKnob.Parent = FOVBar
local FOVKnobCorner = Instance.new("UICorner")
FOVKnobCorner.CornerRadius = UDim.new(1, 0)
FOVKnobCorner.Parent = FOVKnob
local DraggingFOV = false
local function SetFOVFromX(x)
local percent = math.clamp(
(x - FOVBar.AbsolutePosition.X)
/ FOVBar.AbsoluteSize.X,
0,
1
)
Settings.FOV = math.floor(50 + percent * 350)
FOVFill.Size = UDim2.new(percent, 0, 1, 0)
FOVKnob.Position = UDim2.new(percent, 0, 0.5, 0)
FOVValue.Text = tostring(Settings.FOV)
end
FOVBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
DraggingFOV = true
SetFOVFromX(input.Position.X)
end
end)
--========================================================
-- SMOOTHNESS SLIDER
--========================================================
Label("Smoothness", 180)
local SmoothValue = Instance.new("TextLabel")
SmoothValue.BackgroundTransparency = 1
SmoothValue.Position = UDim2.fromOffset(275, 176)
SmoothValue.Size = UDim2.fromOffset(50, 22)
SmoothValue.Text = string.format("%.2f", Settings.Smoothness)
SmoothValue.TextColor3 = Color3.fromRGB(100, 165, 255)
SmoothValue.TextSize = 12
SmoothValue.Font = Enum.Font.GothamBold
SmoothValue.Parent = Main
local SmoothBar = Instance.new("Frame")
SmoothBar.Size = UDim2.fromOffset(235, 6)
SmoothBar.Position = UDim2.fromOffset(20, 208)
SmoothBar.BackgroundColor3 = Color3.fromRGB(43, 43, 54)
SmoothBar.BorderSizePixel = 0
SmoothBar.Parent = Main
local SmoothFill = Instance.new("Frame")
SmoothFill.Size = UDim2.new(
(Settings.Smoothness - 0.02) / 0.48,
0,
1,
0
)
SmoothFill.BackgroundColor3 = Color3.fromRGB(75, 140, 255)
SmoothFill.BorderSizePixel = 0
SmoothFill.Parent = SmoothBar
local SmoothKnob = Instance.new("Frame")
SmoothKnob.Size = UDim2.fromOffset(14, 14)
SmoothKnob.AnchorPoint = Vector2.new(0.5, 0.5)
SmoothKnob.Position = UDim2.new(
(Settings.Smoothness - 0.02) / 0.48,
0,
0.5,
0
)
SmoothKnob.BackgroundColor3 = Color3.fromRGB(240, 240, 245)
SmoothKnob.BorderSizePixel = 0
SmoothKnob.Parent = SmoothBar
local SmoothKnobCorner = Instance.new("UICorner")
SmoothKnobCorner.CornerRadius = UDim.new(1, 0)
SmoothKnobCorner.Parent = SmoothKnob
local DraggingSmooth = false
local function SetSmoothFromX(x)
local percent = math.clamp(
(x - SmoothBar.AbsolutePosition.X)
/ SmoothBar.AbsoluteSize.X,
0,
1
)
Settings.Smoothness =
math.floor((0.02 + percent * 0.48) * 100) / 100
SmoothFill.Size = UDim2.new(percent, 0, 1, 0)
SmoothKnob.Position = UDim2.new(percent, 0, 0.5, 0)
SmoothValue.Text =
string.format("%.2f", Settings.Smoothness)
end
SmoothBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
DraggingSmooth = true
SetSmoothFromX(input.Position.X)
end
end)
--========================================================
-- AIM KEY
--========================================================
Label("Aim Key", 235)
local KeyButton = Button(
Settings.AimKey.Name,
235,
231,
90,
30
)
KeyButton.MouseButton1Click:Connect(function()
WaitingForKey = true
KeyButton.Text = "PRESS KEY"
end)
--========================================================
-- PLAYER SPEED TRACKING
--========================================================
Label("Player Speed Tracking", 280)
local SpeedToggle = Button(
"ON",
255,
276,
70,
30
)
local function UpdateSpeedButton()
if Settings.UsePlayerSpeed then
SpeedToggle.Text = "ON"
SpeedToggle.BackgroundColor3 =
Color3.fromRGB(65, 135, 255)
else
SpeedToggle.Text = "OFF"
SpeedToggle.BackgroundColor3 =
Color3.fromRGB(32, 32, 42)
end
end
SpeedToggle.MouseButton1Click:Connect(function()
Settings.UsePlayerSpeed = not Settings.UsePlayerSpeed
UpdateSpeedButton()
end)
--========================================================
-- STATUS
--========================================================
local Status = Instance.new("TextLabel")
Status.BackgroundTransparency = 1
Status.Position = UDim2.fromOffset(20, 325)
Status.Size = UDim2.fromOffset(310, 40)
Status.Text = "STATUS • READY\nPress Q to toggle target lock"
Status.TextColor3 = Color3.fromRGB(120, 120, 135)
Status.TextSize = 11
Status.Font = Enum.Font.Gotham
Status.TextXAlignment = Enum.TextXAlignment.Left
Status.Parent = Main
--========================================================
-- FOV CIRCLE
--========================================================
local FOVCircle = Instance.new("Frame")
FOVCircle.Name = "FOVCircle"
FOVCircle.AnchorPoint = Vector2.new(0.5, 0.5)
FOVCircle.BackgroundTransparency = 1
FOVCircle.BorderSizePixel = 0
FOVCircle.Parent = Gui
local CircleCorner = Instance.new("UICorner")
CircleCorner.CornerRadius = UDim.new(1, 0)
CircleCorner.Parent = FOVCircle
local CircleStroke = Instance.new("UIStroke")
CircleStroke.Color = Color3.fromRGB(80, 145, 255)
CircleStroke.Thickness = 1
CircleStroke.Transparency = 0.25
CircleStroke.Parent = FOVCircle
--========================================================
-- TARGET SELECTOR
--========================================================
local function GetClosestTarget()
local Camera = workspace.CurrentCamera
if not Camera then
return nil
end
local center = Vector2.new(
Camera.ViewportSize.X / 2,
Camera.ViewportSize.Y / 2
)
local closestCharacter = nil
local closestDistance = Settings.FOV
for _, player in ipairs(Players:GetPlayers()) do
if player == LocalPlayer then
continue
end
-- Team check
if Settings.TeamCheck
and player.Team == LocalPlayer.Team then
continue
end
local character = player.Character
if not character then
continue
end
local humanoid =
character:FindFirstChildOfClass("Humanoid")
local targetPart =
character:FindFirstChild(Settings.TargetPart)
if not humanoid
or humanoid.Health <= 0
or not targetPart then
continue
end
local screenPosition, visible =
Camera:WorldToViewportPoint(
targetPart.Position
)
if not visible then
continue
end
local screenDistance =
(
Vector2.new(
screenPosition.X,
screenPosition.Y
) - center
).Magnitude
if screenDistance < closestDistance then
closestDistance = screenDistance
closestCharacter = character
end
end
return closestCharacter
end
--========================================================
-- AIM / PLAYER SPEED SYSTEM
--========================================================
local function GetPlayerSpeed()
local character = LocalPlayer.Character
if not character then
return 16
end
local humanoid =
character:FindFirstChildOfClass("Humanoid")
if not humanoid then
return 16
end
return humanoid.WalkSpeed
end
local function AimAtTarget(character, deltaTime)
local Camera = workspace.CurrentCamera
if not Camera then
return
end
local targetPart =
character and character:FindFirstChild(
Settings.TargetPart
)
if not targetPart then
return
end
--==============================================
-- NEW PLAYER SPEED SYSTEM
--
-- WalkSpeed 16 = normal speed
-- WalkSpeed 32 = approximately 2x
-- WalkSpeed 8 = approximately 0.5x
--==============================================
local playerSpeed = GetPlayerSpeed()
local speedMultiplier = 1
if Settings.UsePlayerSpeed then
speedMultiplier =
math.clamp(playerSpeed / 16, 0.25, 4)
end
-- Smoothness is the base tracking rate.
local baseTracking = Settings.Smoothness
-- Apply player speed.
local trackingRate =
baseTracking * speedMultiplier
trackingRate =
math.clamp(trackingRate, 0.02, 0.85)
-- Frame-rate independent interpolation.
local alpha =
1 - math.pow(
1 - trackingRate,
deltaTime * 60
)
local targetCFrame =
CFrame.lookAt(
Camera.CFrame.Position,
targetPart.Position
)
Camera.CFrame =
Camera.CFrame:Lerp(
targetCFrame,
alpha
)
end
--========================================================
-- INPUT
--========================================================
UserInputService.InputBegan:Connect(function(input, processed)
if processed then
return
end
-- Changing the keybind
if WaitingForKey then
if input.UserInputType ==
Enum.UserInputType.Keyboard then
Settings.AimKey = input.KeyCode
KeyButton.Text = input.KeyCode.Name
WaitingForKey = false
end
return
end
-- Aim toggle key
if input.KeyCode == Settings.AimKey then
Settings.AimEnabled =
not Settings.AimEnabled
UpdateAimButton()
end
end)
--========================================================
-- INPUT DRAGGING
--========================================================
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType ==
Enum.UserInputType.MouseMovement then
if DraggingFOV then
SetFOVFromX(input.Position.X)
end
if DraggingSmooth then
SetSmoothFromX(input.Position.X)
end
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType ==
Enum.UserInputType.MouseButton1 then
DraggingFOV = false
DraggingSmooth = false
end
end)
--========================================================
-- DRAG WINDOW
--========================================================
local DraggingWindow = false
local DragStart
local StartPosition
TopBar.InputBegan:Connect(function(input)
if input.UserInputType ==
Enum.UserInputType.MouseButton1 then
DraggingWindow = true
DragStart = input.Position
StartPosition = Main.Position
end
end)
UserInputService.InputChanged:Connect(function(input)
if DraggingWindow
and input.UserInputType ==
Enum.UserInputType.MouseMovement then
local delta =
input.Position - DragStart
Main.Position = UDim2.new(
StartPosition.X.Scale,
StartPosition.X.Offset + delta.X,
StartPosition.Y.Scale,
StartPosition.Y.Offset + delta.Y
)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType ==
Enum.UserInputType.MouseButton1 then
DraggingWindow = false
end
end)
--========================================================
-- CLOSE / REOPEN
--========================================================
local Reopen = Instance.new("TextButton")
Reopen.Name = "Reopen"
Reopen.Size = UDim2.fromOffset(52, 52)
Reopen.Position = UDim2.new(
0,
20,
0.5,
-26
)
Reopen.BackgroundColor3 =
Color3.fromRGB(24, 24, 32)
Reopen.Text = "🎯"
Reopen.TextSize = 21
Reopen.TextColor3 =
Color3.fromRGB(235, 235, 245)
Reopen.AutoButtonColor = false
Reopen.Visible = false
Reopen.Parent = Gui
local ReopenCorner = Instance.new("UICorner")
ReopenCorner.CornerRadius = UDim.new(0, 13)
ReopenCorner.Parent = Reopen
local ReopenStroke = Instance.new("UIStroke")
ReopenStroke.Color = Color3.fromRGB(55, 55, 70)
ReopenStroke.Parent = Reopen
Close.MouseButton1Click:Connect(function()
Main.Visible = false
Reopen.Visible = true
end)
Reopen.MouseButton1Click:Connect(function()
Main.Visible = true
Reopen.Visible = false
end)
--========================================================
-- MAIN RENDER LOOP
--========================================================
RunService.RenderStepped:Connect(function(deltaTime)
local Camera = workspace.CurrentCamera
if not Camera then
return
end
-- FOV circle follows screen center
FOVCircle.Position =
UDim2.fromOffset(
Camera.ViewportSize.X / 2,
Camera.ViewportSize.Y / 2
)
FOVCircle.Size =
UDim2.fromOffset(
Settings.FOV * 2,
Settings.FOV * 2
)
-- Aim
if Settings.AimEnabled then
local target =
GetClosestTarget()
if target then
Status.Text =
"STATUS • TRACKING\n" ..
target.Name
AimAtTarget(
target,
deltaTime
)
else
Status.Text =
"STATUS • NO TARGET\n" ..
"Searching inside FOV..."
end
else
Status.Text =
"STATUS • READY\n" ..
"Press " ..
Settings.AimKey.Name ..
" to toggle target lock"
end
end)
--========================================================
-- INITIAL STATE
--========================================================
UpdateAimButton()
UpdateSpeedButton()Title.Text = "DUMI HUB"