Assistant Prompt Guide and Examples

*该内容即将支持你的所选语言。

This document gives guidance on prompting Assistant and provides examples and inspiration on what Assistant can do.

Be Specific

If Assistant fails, add more details to your prompt and try again. Use instance names exactly as they're spelled, specify which function you want Assistant to use, and tell Assistant which type it's working with, such as a part or a model.

Not SpecificMore Specific
Place the trees in a circle.Place 10 copies of the "pine_tree" model in ReplicatedStorage in a 30 stud radius circle around the SpawnLocation.
Make the part move.Add a script to make "my_part" move up and down 10 studs repeatedly using TweenService.
How can I design a core loop?Help me design a fun core loop for my game. I want to build a game where players can hunt treasure as pirates. They can also buy and upgrade pirate ships and battle each other.

Use Your Selection

Selection is a great way of specifying an object or set of objects you want to refer to in your prompt. Select multiple objects and ask Assistant to modify them, make duplicates and place them somewhere, or continue a position pattern like maintaining placement in a line.

Edit Time and Run Time

Assistant sometimes confuses the difference between edit time and run time. If you ask Assistant to take an action, it will likely bias towards doing it at edit time. If you want the action to happen during run time, ask Assistant to insert a script that takes the action. For example, tell Assistant "add a script to make the time of day 8:00 AM" instead of "make the time of day 8:00 AM."

Keep Trying

Don't get discouraged if Assistant doesn't work exactly the way you want the first time. Often, making small tweaks and trying again can lead to better results. Many AI tools are non-deterministic, meaning they don't create the exact same output each time you ask them to do something. There's some variance, which you can tap into and control using tweaks to your prompt.

AI in its current state requires work. It takes time to understand how to best speak to Assistant, what it can do, and how to get what you want out of it.

Multi-Step Prompts

Consider using multi-step prompts to encourage Assistant to think. Instead of asking "Can you explain this script to me?" and pasting in the script, ask it to explain step-by-step by separating the question from the script with ###. This separation helps Assistant deconstruct and organize the information to provide better answers.

Can you explain what this script is doing step by step?

###

local part = workspace.Part

local function onTouched(otherPart)
    print(part.Name .. " collided with " .. otherPart.Name)
end

part.Touched:Connect(onTouched)

###

Examples

These examples demonstrate the vast variety of tasks that Assistant can help with today. Some of them might take a few tries for you to reproduce, but give them a try and see what you can come up with yourself.

Game Mechanics - Shooting Fireballs that Explode

Prompt: Propel a fireball away from the player in the direction the player is facing when the player presses "e". Make the fireball explode when it hits something.

Game Mechanics - Set Up a Teams System and Assign Players

Prompt: Add a script to make a system of teams (red, blue, green, yellow) and assign each player randomly to a team.

Game Mechanics - Temple Run Style Constant Running

Prompt: Make my character run forward constantly like in a temple run game.

Game Mechanics - Fire Power Up

Prompt: Add a script that makes the player light on fire and jump 3 time as high if they press "q". The fire should be attached to the player and move with them. If they press "q" again, turn off the fire and reset the jump power.

Game Mechanics - NPC Lasers

Prompt: Add a script that makes this shoot a laser using a long thin part that's blue and neon at the player if they're within 30 studs.

Add a script to make this look towards and slowly move towards the closest player if they're within 50 studs. Only move in the x and z axes, keep the y axis constant.

Game Mechanics - Interactive NPC

Prompt: This is an NPC. Add a prompt that lets the player interact with it. If the player interacts, have the NPC say "hello [player's name]" where player's name is the actual player's name, in a text pop up.

Add a script that makes this npc always look towards the closest player.

Game Mechanics - NPC Patrolling

Prompt: Add a script to make this NPC move slowly between startpart and endpart repeatedly. It should face the part and then move to it, then face the other part and move to it. If the player comes within 10 studs, turn the NPC red and make it chase the player.

Game Mechanics - Updating Scoreboard

Prompt: Add a script that deletes this and adds 100 to the players score.

Add a script to show the player's score on the scoreboard.

Camera - Locking to Top Down

Prompt: Add a script that locks the camera in a top down view on the player and follow the player, making sure the player remains in the center of the screen.

Camera - Locking to First Person

Prompt: Create a script to lock the camera in first person view.

UI - Drop-down Menu

Prompt: Create a drop down menu with 5 items.

UI - Health Bar

Prompt: Add a part on the ground, when a player touches it, it decreases health by 10%. Put a UI health bar in the upper center of the screen that turns red when the players health is less than 20%.

UI - Simple HUD

Prompt: Create a heads up display in StarterGui. Add a healthbar to the top right, and a text label with the player's name underneath it. In the bottom right, add 4 buttons in a diamond shape, with "Potions" on top, "Weapons" on the left, "Inventory" on the bottom, and "Special" on the right. Make the colors fall color themed.

Building - Scattering Objects with Randomization

Prompt: Add 0-5 of the selected instance "Mushroom" around each "RedwoodTree-Var01".

Building - Night / Day Cycle with Street Lights

Prompt: Add a script that changes the time of day by 1 hour every second. Start at 3pm. At 7pm, turn every spotlight's brightness up to 10. At 8am turn every spotlight's brightness down to 0.

Building - Physics-based Suspension Bridge

Prompt: Create a rope bridge. Make 10 wood planks that are 5 studs wide and 2 studs long. Place them in a row. Add rop constraints on each side of the parts, connecting each one to the part before it and after it. Make all the rope constraints visible, anchor the 1st and 10th part, and add a drag detector on the 1st and 10th part.

Building - Adding Smoke to Chimneys

Prompt: Insert an invisible brick that is non-collidable into every chimney in every house. The brick should have a particle inside it that makes smoke that flows upwards, and the smoke must be white.

Building - Renaming Instances

Prompt: Rename all the "emptyscripts" objects to "Script+uniqueID".

Building - Creating Terrain

Prompt: Create a terrain region with rolling hills.

Building - Adding Behavior at Scale

Prompt: Add a script to make the spotlights in the folder StreetLights flicker on and off randomly.

Building - Replacing Greyboxes with Assets

Prompt: Replace each of the selected parts with a model of the same name currently in the data model inside the AssetLibrary Folder under workspace. For example, if the part is called "Suburban House", look for a model called "Suburban House" and replace the part with that model.