-- Services local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer -- GUI local ScreenGui = Instance.new("ScreenGui", LocalPlayer:WaitForChild("PlayerGui")) ScreenGui.Name = "TouchNameGUI" ScreenGui.ResetOnSpawn = false local Frame = Instance.new("Frame", ScreenGui) Frame.Size = UDim2.new(0, 200, 0, 100) Frame.Position = UDim2.new(0.4, 0, 0.4, 0) Frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35) Frame.Active = true Frame.Draggable = true -- Toggle Button local ToggleBtn = Instance.new("TextButton", Frame) ToggleBtn.Size = UDim2.new(1, 0, 0.4, 0) ToggleBtn.Position = UDim2.new(0, 0, 0, 0) ToggleBtn.Text = "🟢 ON" ToggleBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60) ToggleBtn.TextColor3 = Color3.new(1, 1, 1) ToggleBtn.Font = Enum.Font.SourceSansBold ToggleBtn.TextScaled = true -- Label local InfoLabel = Instance.new("TextLabel", Frame) InfoLabel.Size = UDim2.new(1, 0, 0.6, 0) InfoLabel.Position = UDim2.new(0, 0, 0.4, 0) InfoLabel.Text = "Touch part to get name" InfoLabel.BackgroundColor3 = Color3.fromRGB(25, 25, 25) InfoLabel.TextColor3 = Color3.new(1, 1, 1) InfoLabel.Font = Enum.Font.SourceSans InfoLabel.TextScaled = true InfoLabel.TextWrapped = true -- Logic local enabled = true ToggleBtn.MouseButton1Click:Connect(function() enabled = not enabled ToggleBtn.Text = enabled and "🟢 ON" or "🔴 OFF" end) -- Touch event UIS.InputBegan:Connect(function(input, gpe) if gpe or not enabled then return end if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then local mouse = LocalPlayer:GetMouse() local target = mouse.Target if target then InfoLabel.Text = "📌 Name: " .. target.Name else InfoLabel.Text = "❌ No part touched" end end end)