--At Line 98, please separate the two different scripts or else might not work. local Players = game:GetService("Players") local VirtualInputManager = game:GetService("VirtualInputManager") local LocalPlayer = Players.LocalPlayer local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() local humanoidRootPart = character:WaitForChild("HumanoidRootPart") local attacking = false local lastAttackTime = 0 local attackCooldown = 0.5 local function getNearestPlayer() local nearestPlayer, shortestDistance = nil, math.huge for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local distance = (humanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude if distance < shortestDistance then shortestDistance = distance nearestPlayer = player end end end return nearestPlayer end local function isBlocking(target) local humanoid = target.Parent:FindFirstChildOfClass("Humanoid") if humanoid then for _, anim in ipairs(humanoid:GetPlayingAnimationTracks()) do if anim.Name:lower():find("block") then return true end end end return false end -- Auto m1 local function attack() attacking = true for i = 1, 4 do if not attacking then break end VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 0) task.wait(0.05 + math.random() * 0.05) VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 0) task.wait(0.1 + math.random() * 0.1) end attacking = false end -- Auto Dash local function onDamageTaken() if not attacking then VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, game) task.wait(0.1) VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, game) end end local function canAttack(target) local rayOrigin = humanoidRootPart.Position local rayDirection = (target.Position - rayOrigin).Unit * 5 local ray = Ray.new(rayOrigin, rayDirection) local hitPart, _ = workspace:FindPartOnRay(ray, character, false, true) return hitPart and hitPart.Parent == target.Parent end local function mainLoop() while true do local nearestPlayer = getNearestPlayer() if nearestPlayer and nearestPlayer.Character then local target = nearestPlayer.Character:WaitForChild("HumanoidRootPart") local distance = (humanoidRootPart.Position - target.Position).Magnitude local currentTime = tick() if distance <= 7 and not attacking and not isBlocking(target) and currentTime - lastAttackTime >= attackCooldown and canAttack(target) then lastAttackTime = currentTime attack() end end task.wait(0.2 + math.random() * 0.2) -- Randomized delay for smoother operation end end local function setupCharacter(newCharacter) character = newCharacter humanoidRootPart = character:WaitForChild("HumanoidRootPart") local humanoid = character:WaitForChild("Humanoid") humanoid.HealthChanged:Connect(onDamageTaken) end LocalPlayer.CharacterAdded:Connect(setupCharacter) setupCharacter(character) coroutine.wrap(mainLoop)() getgenv().Camlock_Settings = { Prediction = 0.149, AimPart = "HumanoidRootPart", Key = "e", AutoPrediction = false, Notification = true, Button = true, AntiGroundShots = false, UnderGroundResolver = false, -- DO NOT TOUCH THIS OR THE CAMLOCK WILL NOT WORK -- Version = "2.5.1", Credits = "space_0999", DiscordServer = "discord.gg/SKhamGzTdn" } loadstring(game:HttpGet('https://raw.githubusercontent.com/elxocasXD/Trip-Hub/main/Scripts/Cam%20Lock.lua'))()