[0.2] AI_Playground | Use AI inside Roblox Studio

Introduction

After seeing the rise of ChatGPT (an AI language model which can understand human language and - to some extent - code), it made me wonder how this could be used on Roblox Studio for development purposes. Fast forward a few days, and here it is:

AI Playground is a plugin that incorporates OpenAI’s Davinci language model into Roblox Studio. This plugin can help you do repetitive tasks, it can answer some questions you may have about Studio and a lot of other things.

AI Playground uses HTTP requests to communicate with OpenAI services and create the desired result.

Features

AI Playground currently offers two features:

AskAIPlayground ASK
Ask let you ask Studio-related questions to the AI. It can explain a particular topic, look for mistakes in your code and even write scripts for you! It is the same as going to chat.openai.com but inside Roblox Studio.

What it looks like

Prompt: What is TweenService and how can I use it?

DoAIPlayground DO
Do uses loadstring() to edit your game depending on your input. The AI will analyze your prompt and return a Lua code that it thinks answer the best your question. This code will then be executed into your Studio.

What it looks like

Prompt: Create 50 parts that make a circle

Beginners Guide

Unfortunately, you can’t start right away and experiment freely. OpenAI requires you to set up an API Key before using their services. It is a bit of an inconvenience, but it shouldn’t add that much delay.

Before setting up your OpenAI API Key, you should do the regular installation process. To do that, get the plugin here and enable it by going into “Manage Plugins” on Roblox Studio (in the “Plugins” tab).

Note: AI Playground uses the HTTP Requests and Script Injection permissions. HTTP Request is necessary to contact OpenAI’s servers. Script Injection is required for the DO feature to work properly.

Creating and getting your API key

  • Visit this page and log in/register
  • Click “create a new secret key”
  • Copy this long string of characters
  • Open the plugin on Roblox Studio and go on the settings page SettingsAIPlayground
  • Paste your key into the “OpenAI API Key” field and press enter

More

I just created a Guilded server for this project. If you are interested, check it out here.

Apologies for any english mistakes, it’s not my primary language.

53 Likes

I don’t think I’ll be using this as I like to code things myself, but this is obviously really helpful when I’m confused or somewhat! And for beginners, I don’t think I’ve to explain any further. I love the UI along with the shadow! Nice job!

5 Likes

Will it be able to write realistic working airplane scripts?

Might, and might not.

Yeah, soo…

2 Likes

Here’s the exact example as from the OP in my POV:

And yes, it’s different.

But yeah, I’m surprised it was able to make this.

This works absolutely amazing!

2 Likes

Quick disclaimer that might be important to add related to ChatGPT, which might make this relevant here:

ChatGPT does not provide accurate results for information post-2021 - the information there is very limited. Asking a question about documentation (ex: what is the best way to do X, what is the method to call Y, etc.) can lead to answers that were correct in the past, but are now incorrect due to recent (or not so recent) engine changes. Manually researching documentation is a way to avoid this issue.

^^ The above isn’t a critique of what you’re doing, just something that may be helpful to anyone using this to get a quick idea of Studio/Engine functionality, especially if the provided answer doesn’t pan out successfully.

1 Like

Hi! Thanks for your reply! Yeah, it is currently not accurate enough to be used for broad things such as coding something. We can hope that the technology better itself as time goes on.

You’re right, but it can also be wrong for no specific reason. Sometimes, it tells you things that aren’t true and that were never true.
I quoted your answer on the original post because it’s important for users to be fully fixed about the current state of ChatGPT (or language-AIs in general).

1 Like

What’s the difference between The plugin and website? Unless I’m missing something here.

I plan on training the model on the DevForum to make it up-to-date and better overall, but for now the Ask feature is the same as the website and Do is a bit different but could be easily replicated on the website too.

In short, not much difference as mostly an experimental plugin.

Why is the install button grayed out when trying to install

Also if I ask it to write me a script would it automatically inject it or would I have to do it

I don’t know, I don’t see any issue from my point of view.
EDIT: Try to install it from the new Roblox Marketplace, right here.

I made two features: ASK will write the code without injecting it and DO will execute the code right away.

Please allow the plugin to work directly in scripts. Right now it only works in the workspace!

It’d be great if we could ask it to write something in the script we’re working on and It writes it with context of the full script.

1 Like

Thanks so much I’m looking forward to using and implementing this
Great work!!

Dude this is so cool! I was playing around with it and it works very well!
I asked it to print a Shakespeare quote and it printed this:

image

It does get confused with some things (understandable). I asked it to make a house and It just made a blue cube named “House” :laughing:

Overall though this is very cool! Keep up the good work! :smiley:

1 Like

Depends, it may use old API or maybe API that doesn’t exist so you will have to fix it’s code.

Shhhh, don’t tell the people here that AI’s like ChatGpt use data they’ve found online and build scripts and etc from that. They don’t really “write” it lol

You are right about the way ChatGPT collects data for training, but it could still be considered writing as it creates original work even by using a dataset.

Is there a chance we get the source code open on github?

2 Likes