local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local selectedPlayer = nil local minimized = false local gui = Instance.new("ScreenGui") gui.Name = "PlayerFinder" gui.ResetOnSpawn = false gui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(280, 300) frame.Position = UDim2.new(0, 20, 0.3, 0) frame.BackgroundColor3 = Color3.fromRGB(25, 25, 35) frame.BorderSizePixel = 0 frame.Active = true frame.Parent = gui local function makeButton(text, y, height) local button = Instance.new("TextButton") button.Size = UDim2.new(1, -20, 0, height or 35) button.Position = UDim2.fromOffset(10, y) button.BackgroundColor3 = Color3.fromRGB(55, 80, 160) button.TextColor3 = Color3.new(1, 1, 1) button.TextSize = 14 button.Text = text button.BorderSizePixel = 0 button.Parent = frame return button end -- Draggable title bar local title = Instance.new("Frame") title.Size = UDim2.new(1, 0, 0, 38) title.BackgroundColor3 = Color3.fromRGB(40, 40, 60) title.BorderSizePixel = 0 title.Active = true title.Parent = frame local titleText = Instance.new("TextLabel") titleText.Size = UDim2.new(1, -80, 1, 0) titleText.Position = UDim2.fromOffset(10, 0) titleText.BackgroundTransparency = 1 titleText.Text = "PLAYER FINDER" titleText.TextColor3 = Color3.new(1, 1, 1) titleText.TextSize = 16 titleText.Font = Enum.Font.GothamBold titleText.TextXAlignment = Enum.TextXAlignment.Left titleText.Parent = title local minimizeButton = Instance.new("TextButton") minimizeButton.Size = UDim2.fromOffset(35, 30) minimizeButton.Position = UDim2.new(1, -40, 0, 4) minimizeButton.Text = "-" minimizeButton.TextSize = 22 minimizeButton.TextColor3 = Color3.new(1, 1, 1) minimizeButton.BackgroundColor3 = Color3.fromRGB(75, 75, 100) minimizeButton.BorderSizePixel = 0 minimizeButton.Parent = title -- Everything below the title can be hidden local contents = Instance.new("Frame") contents.Size = UDim2.new(1, 0, 1, -38) contents.Position = UDim2.fromOffset(0, 38) contents.BackgroundTransparency = 1 contents.Parent = frame local search = Instance.new("TextBox") search.Size = UDim2.new(1, -20, 0, 35) search.Position = UDim2.fromOffset(10, 8) search.PlaceholderText = "Enter player name..." search.Text = "" search.TextSize = 14 search.BackgroundColor3 = Color3.fromRGB(45, 45, 55) search.TextColor3 = Color3.new(1, 1, 1) search.ClearTextOnFocus = false search.Parent = contents local function button(text, y) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -20, 0, 35) b.Position = UDim2.fromOffset(10, y) b.BackgroundColor3 = Color3.fromRGB(55, 80, 160) b.TextColor3 = Color3.new(1, 1, 1) b.TextSize = 14 b.Text = text b.BorderSizePixel = 0 b.Parent = contents return b end local searchButton = button("Search Player", 50) local viewButton = button("View Player", 92) local teleportButton = button("Teleport To Player", 134) local stopButton = button("Stop Viewing", 176) local status = Instance.new("TextLabel") status.Size = UDim2.new(1, -20, 0, 30) status.Position = UDim2.fromOffset(10, 220) status.BackgroundColor3 = Color3.fromRGB(35, 35, 45) status.TextColor3 = Color3.new(1, 1, 1) status.TextSize = 12 status.Text = "Enter a player name" status.Parent = contents -- Minimize and restore minimizeButton.MouseButton1Click:Connect(function() minimized = not minimized contents.Visible = not minimized frame.Size = minimized and UDim2.fromOffset(280, 38) or UDim2.fromOffset(280, 300) minimizeButton.Text = minimized and "+" or "-" end) -- Dragging support for mouse and touch local dragging = false local dragInput local dragStart local startPosition title.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPosition = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) title.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if dragging and ( input == dragInput or input.UserInputType == Enum.UserInputType.MouseMovement ) then local delta = input.Position - dragStart frame.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end end) -- Find players in the current server local function findPlayer(query) query = string.lower(query) if query == "" then return nil end for _, target in ipairs(Players:GetPlayers()) do if string.lower(target.Name) == query then return target end end for _, target in ipairs(Players:GetPlayers()) do if string.find(string.lower(target.Name), query, 1, true) or string.find(string.lower(target.DisplayName), query, 1, true) then return target end end return nil end searchButton.MouseButton1Click:Connect(function() selectedPlayer = findPlayer(search.Text) if selectedPlayer then status.Text = "Found: " .. selectedPlayer.Name else status.Text = "Player not found" end end) viewButton.MouseButton1Click:Connect(function() if not selectedPlayer then status.Text = "Search for a player first" return end local character = selectedPlayer.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then workspace.CurrentCamera.CameraSubject = humanoid status.Text = "Viewing: " .. selectedPlayer.Name else status.Text = "Character unavailable" end end) stopButton.MouseButton1Click:Connect(function() local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then workspace.CurrentCamera.CameraSubject = humanoid end status.Text = "Stopped viewing" end) teleportButton.MouseButton1Click:Connect(function() if not selectedPlayer then status.Text = "Search for a player first" return end local targetRoot = selectedPlayer.Character and selectedPlayer.Character:FindFirstChild("HumanoidRootPart") local myRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart") if targetRoot and myRoot then myRoot.CFrame = targetRoot.CFrame * CFrame.new(3, 0, 0) status.Text = "Teleported to " .. selectedPlayer.Name else status.Text = "Character unavailable" end end) Players.PlayerRemoving:Connect(function(leavingPlayer) if selectedPlayer == leavingPlayer then selectedPlayer = nil status.Text = "Selected player left" end end)