RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"code a chatbot GUI that I can ask questions about roblox studio to"
-- local script (StarterGui) local player = game.Players.LocalPlayer local screenGui = Instance.new("ScreenGui", player.PlayerGui) local chatFrame = Instance.new("Frame", screenGui) chatFrame.Size = UDim2.new(0.5, 0, 0.5, 0) chatFrame.Position = UDim2.new(0.25, 0, 0.25, 0) chatFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) chatFrame.BorderSizePixel = 2 chatFrame.BorderColor3 = Color3.fromRGB(0, 0, 0) local chatBox = Instance.new("TextBox", chatFrame) chatBox.Size = UDim2.new(0.9, 0, 0.8, 0) chatBox.Position = UDim2.new(0.05, 0, 0.1, 0) chatBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255) chatBox.BorderSizePixel = 2 chatBox.BorderColor3 = Color3.fromRGB(0, 0, 0) chatBox.ClearTextOnFocus = false chatBox.MultiLine = true chatBox.TextWrapped = true chatBox.TextScaled = true local sendButton = Instance.new("TextButton", chatFrame) sendButton.Size = UDim2.new(0.2, 0, 0.1, 0) sendButton.Position = UDim2.new(0.75, 0, 0.9, 0) sendButton.Text = "Send" sendButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0) sendButton.TextColor3 = Color3.fromRGB(255, 255, 255) sendButton.BorderSizePixel = 2 sendButton.BorderColor3 = Color3.fromRGB(0, 0, 0) local chatLog = Instance.new("ScrollingFrame", chatFrame) chatLog.Size = UDim2.new(0.9, 0, 0.8, 0) chatLog.Position = UDim2.new(0.05, 0, 0.1, 0) chatLog.BackgroundColor3 = Color3.fromRGB(255, 255, 255) chatLog.BorderSizePixel = 2 chatLog.BorderColor3 = Color3.fromRGB(0, 0, 0) chatLog.ScrollBarThickness = 10 local chatLogLayout = Instance.new("UIListLayout", chatLog) chatLogLayout.SortOrder = Enum.SortOrder.LayoutOrder local function addMessage(message) local messageFrame = Instance.new("Frame", chatLog) messageFrame.Size = UDim2.new(0.9, 0, 0, 30) messageFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) messageFrame.BorderSizePixel = 2 messageFrame.BorderColor3 = Color3.fromRGB(0, 0, 0) local messageText = Instance.new("TextLabel", messageFrame) messageText.Size = UDim2.new(0.9, 0, 0.8, 0) messageText.Position = UDim2.new(0.05, 0, 0.1, 0) messageText.BackgroundColor3 = Color3.fromRGB(255, 255, 255) messageText.BorderSizePixel = 0 messageText.TextColor3 = Color3.fromRGB(0, 0, 0) messageText.TextWrapped = true messageText.TextScaled = true messageText.Text = message chatLogLayout:ApplyLayout() chatLog.CanvasSize = UDim2.new(0, 0, 0, chatLogLayout.AbsoluteContentSize.Y) end sendButton.MouseButton1Click:Connect(function() local message = chatBox.Text addMessage("You: " .. message) chatBox.Text = "" -- add code here to process the message and respond accordingly end)