Assistant: Enhanced Script Insertion Unlocks New Use Cases

Hi Creators,

Last year, we introduced Assistant in beta to help empower your creative process. When we launched, Assistant could answer queries, generate materials, explain code, and insert scripts under Parts and MeshParts. Today, we’re expanding Assistant’s scripting capabilities to generate and insert scripts across your entire Datamodel to help you be more productive. This expansion also presents an opportunity for newer creators or non-scripters, who often struggle with script placement in Explorer, to efficiently complete scripting tasks by interacting with Assistant.

How it works

Assistant intelligently uses a combination of your prompt, conversation history, recently created objects by Assistant and the instance you selected in Explorer to

  1. Decide where to place the generated script
  2. The type of the script, namely LocalScript, ModuleScript or Script
  3. The content of the script

If you have a specific instance to which you want to attach a script, please select it in Explorer; if not, Assistant will determine the insertion location for you.

Once the script is in place, you can click “Play” to test it. If the script does not meet your expectations or needs further refinement, you can open the script and edit it with the help of Code Assist. Alternatively, you can delete the generated script and ask the Assistant to regenerate it based on a revised prompt.

Let’s walk through some examples of what’s now possible with Assistant. We’ll use a tree collection simulation game as an example.

Randomly change a model’s behavior

Let’s say you want to inject a little randomness into your experience. You can now select a Model of a Tree and ask Assistant to “Make a Script to change the color of this tree’s leaves every second”.

Change the color of tree leaves every second

Create and update a leaderboard: tracking points and resetting on player death

You may want to make your game more competitive by adding a leaderboard. Assistant can help.

First, just ask it, "Make a script to set up a leaderboard with Points stats”. Assistant will create a leaderboard and insert it in ServerScriptService.

Next, you’ll want to update the leaderboard when someone collects a tree. You can give Assistant the prompt, “Make a script so that if a player touches this, increase points by 1, and remove the tree”. You can see that it attached a script to the model, which updates the leaderboard.

For added excitement, if you want to make the game a little higher stakes, you can make some trees kill the player. Try asking Assistant, “Make a script to kill the player if they touch this”. Assistant inserts a script into the tree model that sets humanoid.Health to 0 and kills the player.

Lastly, to make it even more challenging, you can set a player’s points to zero when they die. Use the prompt, “Make a script to reset Points stats when a user dies”. Assistant will generate a script and attach it to StarterCharacterScripts that resets the player’s point totals.

A step-by-step demo of creating and updating a leaderboard

Change the scene

If you want to add even more excitement to your game, you can now use Assistant to change the lighting or properties of your environment. Try the prompt, “Make a script to smoothly transition between day/night cycle with a period of 6”.

Assistant will insert a script into ServerScriptService and you can see the scene cycle from day to night.

Note: For demo purposes, the cycleTime in the script was manually changed from 360s to 6s to showcase a day/night transition.

Transition between day/night cycle

Getting started with Assistant

How to Enable Assistant in Studio

Assistant is a beta feature. To enable Assistant:

  1. Go to File → Beta Features and check the Assistant box.
  2. Restart Studio
  3. Click Assistant in the top right corner of Studio

Known Limitations & Issues

  • One pass generation & insertion: You can’t tell Assistant to iterate if it responds incorrectly to your prompt. We’re working on enabling iteration by adding Script debugging and modification, targeting the 2nd half of the year.
  • Single script insertion: Assistant can only insert one script at a time. Some more complex tasks may require multiple scripts.
  • Non-deterministic output: Given your chat history or DataModel hierarchy, it may generate and insert different scripts. You may sometimes need to clear your chat history to get the correct output.

Feedback wanted

Please use the thumbs up and thumbs down buttons when you receive responses from the Assistant. We used that feedback to help us build this capability by identifying which common requests Assistant had trouble fulfilling.

Thank you for making this happen @Genichiroblox, @ToubatB and @swish741! Happy AI scripting!

128 Likes

This topic was automatically opened after 10 minutes.

The AI has come in clutch every now and then. Of course, what it would complete for me wouldn’t be considered impressive to make as a person, but nonetheless, it has been getting better over time. I’m intrigued where it will go.


But I would like to add one thing, please make it either customizeable or different with what triggers the AI to complete your code. At the moment, it starts generating a response as soon as you type ‘=’. Example:

local player = ...

Right that second it starts computing away and attempt to solve it, even though I do not want it to. I much rather ask the assistant myself or use a custom key combination. I.e. I type ‘//’, it will generate a response, and when I press tab it will delete the ‘//’ and place the code. That way it’s much less intrusive.

53 Likes

If you type more characters/press the wrong key to prevent the AI’s suggestion, then for some reason I just can’t get the AI to come with a suggestion again, this especially bothers me if I accidentally press something but am actually interested in the AI’s suggestion, just for it to disappear and not come back.

21 Likes

I hardly trust AI because it’s at it’s early stages, I only use AI if I’m stuck on something and may need assistance with an AI or I’m unable to find the issue myself.

20 Likes

I wish I had this technology when I was starting off - my career would have been sped up immensely! I’m excited for the Assistant to be able to generate & modify scenes based on prompts. “Add a campground and surrounding mountains, make sure the campfire is lit” for example.

Nice update.

16 Likes

AI is like a helpful friend you can use it to save time and effort so don’t miss the opportunity to benefit from it :grinning:

18 Likes

this is super helpful for an amatuer scripter like me. it can better help me to understand how scripts work. this is awesome, good job guys!

16 Likes

Impressive technology, but I don’t think this should be targeted towards scripters who are trying to grow their skills. Any learning process is done by repeated action and experiments, not having something else do all the work for you. I have other complaints regarding the AI itself. The Assistant widget has very weird UI when compared to other studio UI. Whenever I test out the capabilities it usually does not generate what I am asking for. Even if you did want to promote this technology towards beginner scripters, the generated output is littered with bad practices. For example, there is usage of wait instead of task.wait in the examples you have shown. Sometimes it feels like the AI was purely trained off of toolbox code instead of additionally adhering to the API and documentation. I am one of those people who don’t really like using AI at all for solving coding problems, usually because it overcomplicates things. I turned off the auto-suggest feature in the studio editor, and only find myself using it sparingly when I need to write code that is repetitive/boilerplate; but even then the AI is sometimes still not even capable of doing that.

My last complaint for now is the code being generated in the chat window feels clunky. I would much prefer it to output to a script or temporary script widget that you can accept/reject.

I am not completely against all AI products. The material and texture generators are great examples of well-designed, useful products.

Example Issues

Assistant Widget Has Weird UI
I dislike how rounded the corners are, the alignment feels weird, and when compared to other studio UI it feels out of place.
image

Clearing Chat is Inconsistent
When you press the 3 dots and clear chat, there is no initial “what can I help you with” message. A better feeling system would be to potentially save chats, and at least have a “New Chat” button instead. Also don’t hide this button inside of a menu that is oddly positioned below the text field.
image

It Frequently Breaks
Often times it does not even respond with what I am looking for. The full response in the code block is:

-- This code snippet is empty, so I cannot explain the task.wait function without any code to analyze. If you provide the specific code that uses task.wait, I would be happy to explain its functionality.

image

19 Likes

you can also use Alt-\ on windows (unsure of the mac equivalent) to automatically trigger an assistant suggestion. i agree though, there should be a way to make the autocomplete only manually run at least

12 Likes

The current AI model, despite its association with Roblox, lacks a deep understanding of fundamental Roblox elements like Roblox Studio and Engine APIs. It’s concerning that it doesn’t keep up with recent updates, such as the task library and Studio beta features like EditableImages, which are vital for developers.

As a developer eager to learn efficiently, I had hoped the AI could provide summaries of documentation and explanations of new features. However, it seems to fall short in this regard. While I acknowledge the hard work of the engineers behind it, there’s a pressing need for the AI to evolve and better serve developers seeking assistance with the latest Roblox technologies.

12 Likes

Seems pretty nice, also I’m not sure if this has been reported or how to report it but you guys are testing changes to the devforums in production…

8 Likes

Most of what I code is so beyond what the AI is capable of especially as it is not that good with being aware of other modulescripts. When pairing an AI to understand, with a mediocre intellisense, it is just a sub-par experience so bad that the first thing I do is disable the AI altogether. Sure, it is in the early stages, but it is really annoying that there are some features that ged fed down your throat almost forcefully with popup notifications of “do you with to opt in” to x y z, while all I want is Roblox Studio to not crash every 25th run. I would rather have a robust software that “just works” than a quirky “look at what we can do” software that is sub-par and a buggy mess. Personally, Roblox Studio has so much going for it but Roblox would rather focus on adding new un-needed features than simply refining the very things it is good at. The intellisense is so bad that it gives way too many false positives and red underlines for things that I know will work without a problem at run-time. I would rather have new engine features and updates that are simple and easy to follow yet allows sophisticated and advanced capabilities, like an improved VRService that doesn’t seem so limited in functionality, or viewportframes to have a check mark to duplicate a world’s rendering in 1:1 for scopes in FPS shooters. I want to see progress of things that can make Roblox better as a platform instead of a bandwagon slop that convinces people that this sort of thing is somehow revolutionary when the truth of the matter is it creates more bugs and errors that the developers don’t know how to solve. Let ChatGPT do the coding because I will gauruntee you that ChatGPT is leagues greater than any AI Roblox will ever produce because Roblox is a game development company while ChatGPT is an AI development company. Therefore, there are certain times where it is better to use something made by another than to pay hundreds of millions of dollars into a money firepit that only does a fraction of what we, the community, expected of a software in the first place.

13 Likes

Thank you for your feedback! It’s crucial for us to understand Roblox use cases and APIs thoroughly. Our AI continuously learns and improves based on the data and feedback provided by creators like you. If an answer doesn’t meet your needs, please don’t hesitate to give it a thumbs down.

Importantly, the AI’s scripting capability grows with high-quality Lua/Luau code shared by our community through our data sharing program. The more high quality data we collect, the smarter our models become.

11 Likes

image in particular

15 Likes

And where’s the building extension shown on RDC? And the communication to the other AI’s in studio?

5 Likes

I’m starting to fall in love with AI, and I’m glad Roblox is incorporating it into Roblox Studio.

6 Likes

finally, someone said it at last…

5 Likes

I use assistant pretty often because in most cases it understands what I am trying to do and does it correctly, however, please look into the issue with it putting too many ends that already exist. (or ends in wrong places)

If it generates something inside a long script, it tends to close its generation with too many end lines. Very time-saving though!

5 Likes

As much as AI is cool, is there any news on the Ban API we were promised?

6 Likes