Version / Update: v1.0.0
- Download / Script Link
- -- Ts for my Dahoodians
local plrs = game:GetService("Players")
local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local sg = game:GetService("StarterGui")
local cam = workspace.CurrentCamera
local lp = plrs.LocalPlayer
local config = {
enabled = true,
key = Enum.KeyCode.Q,
part = "Head",
y_offset = -0.6,
fov = 120,
thick = 1,
idle_clr = Color3.fromRGB(255, 0, 0),
target_clr = Color3.fromRGB(0, 255, 0)
}
local target = nil
local circle = Drawing.new("Circle")
circle.Visible = true
circle.Filled = false
circle.Radius = config.fov
circle.Thickness = config.thick
circle.Position = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)
circle.Color = config.idle_clr
local function notify(title, msg)
sg:SetCore("SendNotification", {
Title = title,
Text = msg,
Duration = 2
})
end
local function get_closest()
local dist = config.fov
local temp_target = nil
for i, v in pairs(plrs:GetPlayers()) do
if v ~= lp and v.Character and v.Character:FindFirstChild(config.part) then
local pos, vis = cam:WorldToViewportPoint(v.Character[config.part].Position)
if vis then
local mag = (Vector2.new(pos.X, pos.Y) - Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)).Magnitude
if mag < dist then
dist = mag
temp_target = v.Character[config.part]
end
end
end
end
return temp_target
end
uis.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == config.key then
if target then
target = nil
notify("Camlock", "Unlocked")
else
local found = get_closest()
if found then
target = found
local name = plrs:GetPlayerFromCharacter(target.Parent).Name
notify("Camlock", "Locked onto: " .. name)
end
end
end
end)
rs.RenderStepped:Connect(function()
circle.Position = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)
local check = get_closest()
if check then
circle.Color = config.target_clr
else
circle.Color = config.idle_clr
end
if target and target.Parent then
local lock_pos = target.Position + Vector3.new(0, config.y_offset, 0)
cam.CFrame = CFrame.new(cam.CFrame.Position, lock_pos)
else
target = nil
end
end)[ View More ]
Cool ass Camlock for any Dahood related games