RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"a working chatGPT gui that answers questions about roblox studio using http requests"
-- ChatGPT GUI is not possible directly in Roblox due to API restrictions, but you can use an external server to handle API requests -- Server script (ServerScriptService) local HttpService = game:GetService("HttpService") local API_URL = "https://your-external-server.com/chatgpt" -- Replace with your external server URL function onRequest(player, question) local data = { player = player.UserId, question = question } local headers = { ["Content-Type"] = "application/json" } local response = HttpService:RequestAsync({ Url = API_URL, Method = "POST", Headers = headers, Body = HttpService:JSONEncode(data) }) if response.Success then local responseData = HttpService:JSONDecode(response.Body) return responseData.answer else return "Error: Unable to fetch answer" end end game.ReplicatedStorage.ChatGPT.OnServerInvoke = onRequest -- Local script (inside a ScreenGui) local ReplicatedStorage = game:GetService("ReplicatedStorage") local ChatGPT = ReplicatedStorage:WaitForChild("ChatGPT") local textBox = script.Parent.TextBox local submitButton = script.Parent.SubmitButton local answerLabel = script.Parent.AnswerLabel submitButton.MouseButton1Click:Connect(function() local question = textBox.Text local answer = ChatGPT:InvokeServer(game.Players.LocalPlayer, question) answerLabel.Text = "Answer: " .. answer end) -- Note: You'll need to set up an external server to handle the ChatGPT API requests and return the answer to Roblox. This is because Roblox does not allow direct API requests to external services like OpenAI's ChatGPT.