local Players = game:GetService("Players") local RunService = game:GetService("RunService") local plr = Players.LocalPlayer local maxAngle = 25 local holdTime = 2 local W, H = 250, 150 local timers = {} local gui = Instance.new("ScreenGui", plr.PlayerGui) gui.Name = "LookAtYou" gui.ResetOnSpawn = false gui.IgnoreGuiInset = true gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling local dragArea = Instance.new("Frame", gui) dragArea.Size = UDim2.new(1, 0, 1, 0) dragArea.BackgroundTransparency = 1 dragArea.ZIndex = 1 local frame = Instance.new("Frame", gui) frame.Size = UDim2.new(0, W, 0, H) frame.Position = UDim2.new(0, 50, 0, 50) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 2 frame.BorderColor3 = Color3.new(1, 1, 1) frame.BackgroundTransparency = 0.2 frame.ZIndex = 10 local title = Instance.new("TextLabel", frame) title.Size = UDim2.new(1, 0, 0, 24) title.BackgroundTransparency = 1 title.Text = "Looking At You:" title.TextColor3 = Color3.new(1, 1, 1) title.TextSize = 18 title.Font = Enum.Font.SourceSansBold title.TextXAlignment = Enum.TextXAlignment.Center title.ZIndex = 11 local list = Instance.new("ScrollingFrame", frame) list.Size = UDim2.new(1, -10, 1, -30) list.Position = UDim2.new(0, 5, 0, 26) list.BackgroundTransparency = 1 list.BorderSizePixel = 0 list.ScrollBarThickness = 4 list.ZIndex = 11 local layout = Instance.new("UIListLayout", list) layout.Padding = UDim.new(0, 2) layout.SortOrder = Enum.SortOrder.LayoutOrder -- Drag vars local dragging, dragStart, frameStart dragArea.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 then dragging = true dragStart = i.Position frameStart = frame.Position i.Changed:Connect(function() if i.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) dragArea.InputChanged:Connect(function(i) if dragging and i.UserInputType == Enum.UserInputType.MouseMovement then local delta = i.Position - dragStart local screen = workspace.CurrentCamera.ViewportSize local size = frame.AbsoluteSize local newX = frameStart.X.Offset + delta.X local newY = frameStart.Y.Offset + delta.Y newX = math.clamp(newX, 0, screen.X - size.X) newY = math.clamp(newY, 0, screen.Y - size.Y) frame.Position = UDim2.new(0, newX, 0, newY) end end) local function lookingAtMe(char, myHead) local head = char and char:FindFirstChild("Head") if not head then return false end local lv = head.CFrame.LookVector local toMe = (myHead - head.Position).Unit local angle = math.deg(math.acos(lv:Dot(toMe))) return angle <= maxAngle end RunService.Heartbeat:Connect(function(dt) local char = plr.Character if not char or not char:FindFirstChild("Head") then for _, v in pairs(list:GetChildren()) do if v:IsA("TextLabel") then v:Destroy() end end return end local myPos = char.Head.Position for _, p in pairs(Players:GetPlayers()) do if p ~= plr and p.Character and p.Character:FindFirstChild("Head") then if lookingAtMe(p.Character, myPos) then timers[p.UserId] = (timers[p.UserId] or 0) + dt else timers[p.UserId] = 0 end end end local red, yellow, green = {}, {}, {} for _, p in pairs(Players:GetPlayers()) do if p ~= plr then local t = timers[p.UserId] or 0 if t >= holdTime then table.insert(red, p) elseif t > 0 then table.insert(yellow, p) else table.insert(green, p) end end end for _, v in pairs(list:GetChildren()) do if v:IsA("TextLabel") then v:Destroy() end end local function addLabel(p, col) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1, 0, 0, 20) lbl.BackgroundTransparency = 1 lbl.TextColor3 = col lbl.Text = p.Name lbl.Font = Enum.Font.SourceSans lbl.TextSize = 16 lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.ZIndex = 12 lbl.Parent = list end for _, p in ipairs(red) do addLabel(p, Color3.new(1, 0, 0)) end for _, p in ipairs(yellow) do addLabel(p, Color3.new(1, 1, 0)) end for _, p in ipairs(green) do addLabel(p, Color3.new(0, 1, 0)) end local sizeY = layout.AbsoluteContentSize.Y list.CanvasSize = UDim2.new(0, 0, 0, sizeY) end)