local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local localPlayer = Players.LocalPlayer -- Default settings local defaultTitle = "RP NAME" local currentTitle = defaultTitle -- Create GUI local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = "RPNameConfig" ScreenGui.Parent = localPlayer:WaitForChild("PlayerGui") -- Main frame (initially visible) local MainFrame = Instance.new("Frame") MainFrame.Size = UDim2.new(0, 250, 0, 150) MainFrame.Position = UDim2.new(0, 20, 0, 20) MainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) MainFrame.BorderSizePixel = 0 MainFrame.Visible = true MainFrame.Parent = ScreenGui -- Window title local TitleLabel = Instance.new("TextLabel") TitleLabel.Size = UDim2.new(1, 0, 0, 30) TitleLabel.Position = UDim2.new(0, 0, 0, 0) TitleLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30) TitleLabel.TextColor3 = Color3.new(1, 1, 1) TitleLabel.Text = "RP Title Settings" TitleLabel.Font = Enum.Font.SourceSansBold TitleLabel.TextSize = 16 TitleLabel.Parent = MainFrame -- Hide button (in the corner of the main window) local HideButton = Instance.new("TextButton") HideButton.Size = UDim2.new(0, 30, 0, 30) HideButton.Position = UDim2.new(1, -30, 0, 0) HideButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) HideButton.TextColor3 = Color3.new(1, 1, 1) HideButton.Text = "✕" HideButton.Font = Enum.Font.SourceSansBold HideButton.TextSize = 16 HideButton.Parent = MainFrame -- Instruction text local InfoLabel = Instance.new("TextLabel") InfoLabel.Size = UDim2.new(0.9, 0, 0, 40) InfoLabel.Position = UDim2.new(0.05, 0, 0, 35) InfoLabel.BackgroundTransparency = 1 InfoLabel.TextColor3 = Color3.new(1, 1, 1) InfoLabel.Text = "Set the title that will always\ndisplay instead of 'RP NAME'" InfoLabel.Font = Enum.Font.SourceSans InfoLabel.TextSize = 12 InfoLabel.TextXAlignment = Enum.TextXAlignment.Left InfoLabel.TextYAlignment = Enum.TextYAlignment.Top InfoLabel.Parent = MainFrame -- Title input field local TitleBox = Instance.new("TextBox") TitleBox.Size = UDim2.new(0.9, 0, 0, 30) TitleBox.Position = UDim2.new(0.05, 0, 0, 80) TitleBox.BackgroundColor3 = Color3.fromRGB(60, 60, 60) TitleBox.TextColor3 = Color3.new(1, 1, 1) TitleBox.Text = currentTitle TitleBox.PlaceholderText = "Enter title..." TitleBox.Font = Enum.Font.SourceSans TitleBox.TextSize = 14 TitleBox.Parent = MainFrame -- Save button local SaveButton = Instance.new("TextButton") SaveButton.Size = UDim2.new(0.9, 0, 0, 30) SaveButton.Position = UDim2.new(0.05, 0, 0, 115) SaveButton.BackgroundColor3 = Color3.fromRGB(0, 120, 215) SaveButton.TextColor3 = Color3.new(1, 1, 1) SaveButton.Text = "Save Title" SaveButton.Font = Enum.Font.SourceSansBold SaveButton.TextSize = 14 SaveButton.Parent = MainFrame -- Status indicator local StatusLabel = Instance.new("TextLabel") StatusLabel.Size = UDim2.new(0.9, 0, 0, 20) StatusLabel.Position = UDim2.new(0.05, 0, 0, 150) StatusLabel.BackgroundTransparency = 1 StatusLabel.TextColor3 = Color3.new(0, 1, 0) StatusLabel.Text = "Ready! Chat normally" StatusLabel.Font = Enum.Font.SourceSans StatusLabel.TextSize = 12 StatusLabel.Visible = false StatusLabel.Parent = ScreenGui -- Small toggle button for showing GUI (initially hidden) local ToggleButton = Instance.new("TextButton") ToggleButton.Size = UDim2.new(0, 40, 0, 40) ToggleButton.Position = UDim2.new(0, 20, 0, 20) ToggleButton.BackgroundColor3 = Color3.fromRGB(0, 120, 215) ToggleButton.TextColor3 = Color3.new(1, 1, 1) ToggleButton.Text = "⚙" ToggleButton.Font = Enum.Font.SourceSansBold ToggleButton.TextSize = 20 ToggleButton.Visible = false ToggleButton.Parent = ScreenGui -- Function to send RP name local function sendRPName(messageText) local args = { "use", { { color = Color3.new(1, 1, 1), text = currentTitle, font = Enum.Font.SourceSans }, { color = Color3.new(1, 1, 1), text = messageText, font = Enum.Font.SourceSans } } } ReplicatedStorage:WaitForChild("Events"):WaitForChild("RPName"):FireServer(unpack(args)) end -- Chat handler localPlayer.Chatted:Connect(function(message) if not string.match(message, "^%/") then sendRPName(message) end end) -- Function to show status local function showStatus(text, color) StatusLabel.TextColor3 = color StatusLabel.Text = text StatusLabel.Visible = true task.wait(3) StatusLabel.Visible = false end -- Title save handler SaveButton.MouseButton1Click:Connect(function() local newTitle = TitleBox.Text if newTitle ~= "" then currentTitle = newTitle showStatus("Title saved: " .. currentTitle, Color3.new(0, 1, 0)) print("RP title changed to: " .. currentTitle) end end) -- Auto-save on Enter TitleBox.FocusLost:Connect(function(enterPressed) if enterPressed then SaveButton:MouseButton1Click() end end) -- Function to hide GUI HideButton.MouseButton1Click:Connect(function() MainFrame.Visible = false ToggleButton.Visible = true ToggleButton.Position = MainFrame.Position showStatus("GUI hidden. Click ⚙ to show", Color3.new(1, 0.5, 0)) end) -- Function to show GUI ToggleButton.MouseButton1Click:Connect(function() MainFrame.Visible = true ToggleButton.Visible = false showStatus("GUI opened", Color3.new(0, 1, 0)) end) -- Main window dragging local draggingMain = false local dragInputMain, dragStartMain, startPosMain TitleLabel.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then draggingMain = true dragStartMain = input.Position startPosMain = MainFrame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then draggingMain = false end end) end end) TitleLabel.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then dragInputMain = input end end) -- Toggle button dragging local draggingToggle = false local dragInputToggle, dragStartToggle, startPosToggle ToggleButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then draggingToggle = true dragStartToggle = input.Position startPosToggle = ToggleButton.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then draggingToggle = false end end) end end) ToggleButton.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then dragInputToggle = input end end) -- Drag processing game:GetService("UserInputService").InputChanged:Connect(function(input) if draggingMain and input == dragInputMain then local delta = input.Position - dragStartMain MainFrame.Position = UDim2.new( startPosMain.X.Scale, startPosMain.X.Offset + delta.X, startPosMain.Y.Scale, startPosMain.Y.Offset + delta.Y ) elseif draggingToggle and input == dragInputToggle then local delta = input.Position - dragStartToggle ToggleButton.Position = UDim2.new( startPosToggle.X.Scale, startPosToggle.X.Offset + delta.X, startPosToggle.Y.Scale, startPosToggle.Y.Offset + delta.Y ) end end) -- Hotkey for showing/hiding GUI (F2) game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed) if not gameProcessed then if input.KeyCode == Enum.KeyCode.F2 then if MainFrame.Visible then HideButton:MouseButton1Click() else ToggleButton:MouseButton1Click() end end end end) -- Instructions print("=== RP Name System ===") print("Set the title in the GUI window") print("Then chat normally - messages will be sent with the set title") print("Current title: " .. currentTitle) print("Click ✕ to hide GUI (⚙ button will appear)") print("Press F2 to quickly toggle GUI visibility")