local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local Character = nil local nextRandom = 0 local spectatorDir = nil local didRotate = false local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Blacklist local function getCharacter() local char = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() while not char:FindFirstChild("HumanoidRootPart") or not char:FindFirstChild("Humanoid") do char.ChildAdded:Wait() end return char end local function getRoleFolder(model) local pf = Workspace:FindFirstChild("Players") if not pf then return "Unknown" end for _, folder in ipairs(pf:GetChildren()) do if folder:IsA("Folder") then for _, m in ipairs(folder:GetChildren()) do if m == model then return folder.Name end end end end return "Unknown" end local function getNearestTarget(filter) local best, dist = nil, math.huge for _, pl in ipairs(Players:GetPlayers()) do if pl ~= LocalPlayer and pl.Character and pl.Character:FindFirstChild("HumanoidRootPart") then local m = pl.Character if filter(m) then local d = (m.HumanoidRootPart.Position - Character.HumanoidRootPart.Position).Magnitude if d < dist then dist, best = d, m end end end end return best, dist end -- Lerp functions local function lerpFast(dir) local root = Character and Character:FindFirstChild("HumanoidRootPart") if not root or dir.Magnitude == 0 then return end local cur = root.CFrame.LookVector local tgt = dir.Unit local lerped = cur:Lerp(tgt, 0.2) root.CFrame = CFrame.new(root.Position, root.Position + lerped) didRotate = true end local function lerpSpectator(dir) local root = Character and Character:FindFirstChild("HumanoidRootPart") if not root or dir.Magnitude == 0 then return end local cur = root.CFrame.LookVector local tgt = dir.Unit local lerped = cur:Lerp(tgt, 0.05) root.CFrame = CFrame.new(root.Position, root.Position + lerped) didRotate = true end local function lerpMove(dir) local root = Character and Character:FindFirstChild("HumanoidRootPart") if not root or dir.Magnitude == 0 then return end local cur = root.CFrame.LookVector local tgt = dir.Unit local lerped = cur:Lerp(tgt, 0.1) root.CFrame = CFrame.new(root.Position, root.Position + lerped) didRotate = true end -- Visibility check local function canSee(targetPart) local root = Character.HumanoidRootPart rayParams.FilterDescendantsInstances = { Character } local ray = Workspace:Raycast(root.Position, targetPart.Position - root.Position, rayParams) return not ray or ray.Instance:IsDescendantOf(targetPart.Parent) end local function lookAtTarget(model) local root = Character and Character:FindFirstChild("HumanoidRootPart") if root and canSee(model.HumanoidRootPart) then lerpFast((model.HumanoidRootPart.Position - root.Position) * Vector3.new(1, 0, 1)) end end local function lookAwayFrom(model) local root = Character and Character:FindFirstChild("HumanoidRootPart") if root and canSee(model.HumanoidRootPart) then lerpFast((root.Position - model.HumanoidRootPart.Position) * Vector3.new(1, 0, 1)) end end local function randomDir() local a = math.random() * 2 * math.pi return Vector3.new(math.cos(a), 0, math.sin(a)) end local function onStep() if not Character or not Character:FindFirstChild("HumanoidRootPart") then return end -- Skip if in kill animation local hs = 0 for _, c in ipairs(Character:GetChildren()) do if c:IsA("Humanoid") then hs += 1 end end if hs > 1 then return end local humanoid = Character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.AutoRotate = false end didRotate = false local modelName = Character.Name local role = getRoleFolder(Character) if role == "Killers" then if (modelName == "1x1x1x1" or modelName == "John Doe") and humanoid and humanoid.MoveDirection.Magnitude == 0 then local nearest = getNearestTarget(function(m) return m.Parent and m.Parent.Name == "Survivors" end) if nearest then lookAtTarget(nearest) end else local lowest, lowHP = nil, math.huge for _, pl in ipairs(Players:GetPlayers()) do if pl ~= LocalPlayer and pl.Character and pl.Character:FindFirstChild("HumanoidRootPart") then local model = pl.Character if model.Parent and model.Parent.Name == "Survivors" and model:FindFirstChild("Humanoid") then local hp = model.Humanoid.Health if hp < lowHP then lowHP = hp lowest = model end end end end if lowest then lookAtTarget(lowest) end end elseif role == "Survivors" then if modelName == "Elliot" then local tgt = getNearestTarget(function(m) return m.Parent.Name == "Survivors" and m:FindFirstChild("Humanoid") and m.Humanoid.Health < 75 end) if tgt then lookAtTarget(tgt) end elseif modelName == "007n7" or modelName == "Noob" then local tgt, d = getNearestTarget(function(m) return m.Parent.Name == "Killers" end) if tgt and d <= 50 then lookAwayFrom(tgt) end else local tgt, d = getNearestTarget(function(m) return m.Parent.Name == "Killers" end) if tgt and d <= 20 then lookAtTarget(tgt) end end elseif role == "Spectating" then if humanoid and humanoid.MoveDirection.Magnitude == 0 then if os.clock() >= nextRandom then spectatorDir = randomDir() nextRandom = os.clock() + math.random(30,300)/100 end if spectatorDir then lerpSpectator(spectatorDir) end end end if not didRotate and humanoid and humanoid.MoveDirection.Magnitude > 0 then lerpMove(humanoid.MoveDirection) end end local function setupChar() Character = getCharacter() local h = Character:FindFirstChildOfClass("Humanoid") if h then h.Died:Connect(function() Character = nil end) end end LocalPlayer.CharacterAdded:Connect(setupChar) if LocalPlayer.Character then task.wait(1); setupChar() end RunService.RenderStepped:Connect(onStep)