RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"code a chatbot GUI that I can ask questions about roblox studio to"
-- Create the GUI local ChatbotGUI = Instance.new("ScreenGui") ChatbotGUI.Name = "ChatbotGUI" ChatbotGUI.Parent = game.CoreGui -- Create the main frame local MainFrame = Instance.new("Frame") MainFrame.Name = "MainFrame" MainFrame.Parent = ChatbotGUI MainFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MainFrame.BorderSizePixel = 0 MainFrame.Position = UDim2.new(0.25, 0, 0.25, 0) MainFrame.Size = UDim2.new(0.5, 0, 0.5, 0) -- Create the chat window local ChatWindow = Instance.new("ScrollingFrame") ChatWindow.Name = "ChatWindow" ChatWindow.Parent = MainFrame ChatWindow.BackgroundColor3 = Color3.fromRGB(255, 255, 255) ChatWindow.BorderSizePixel = 0 ChatWindow.Position = UDim2.new(0, 0, 0, 0) ChatWindow.Size = UDim2.new(1, 0, 0.75, 0) -- Create the input field local InputField = Instance.new("TextBox") InputField.Name = "InputField" InputField.Parent = MainFrame InputField.BackgroundColor3 = Color3.fromRGB(255, 255, 255) InputField.BorderSizePixel = 0 InputField.Position = UDim2.new(0, 0, 0.75, 0) InputField.Size = UDim2.new(1, 0, 0.25, 0) -- Create the submit button local SubmitButton = Instance.new("TextButton") SubmitButton.Name = "SubmitButton" SubmitButton.Parent = MainFrame SubmitButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255) SubmitButton.BorderSizePixel = 0 SubmitButton.Position = UDim2.new(0.75, 0, 0.75, 0) SubmitButton.Size = UDim2.new(0.25, 0, 0.25, 0) SubmitButton.Text = "Submit" -- Create the chatbot local Chatbot = Instance.new("ModuleScript") Chatbot.Name = "Chatbot" Chatbot.Parent = ChatbotGUI -- Function to add a message to the chat window local function AddMessage(message) local MessageLabel = Instance.new("TextLabel") MessageLabel.Name = "MessageLabel" MessageLabel.Parent = ChatWindow MessageLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255) MessageLabel.BorderSizePixel = 0 MessageLabel.Position = UDim2.new(0, 0, 0, #ChatWindow:GetChildren() * 20) MessageLabel.Size = UDim2.new(1, 0, 0, 20) MessageLabel.Text = message end -- Function to handle user input local function HandleInput(input) if input == "How do I use Roblox Studio?" then AddMessage("Roblox Studio is a powerful tool used to create and publish Roblox games. You can find tutorials on how to use it here: https://developer.roblox.com/en-us/tutorials") else AddMessage("I'm sorry, I don't understand.") end end -- Connect the submit button SubmitButton.MouseButton1Click:Connect(function() HandleInput(InputField.Text) InputField.Text = "" end)