Lesson 3
Prompts that get good code
Goal: Ask in a way that produces code you can check.
about 5 min3 practice exercises
The quality of what you get back depends on what you put in. Four habits do most of the work.
1. Give context. The assistant does not know your game. Say what the game is, where things live (which services and folders), and your rules: the server decides, no free models, typed Luau.
2. Ask for a plan first. "List the scripts and RemoteEvents you would create and what each does. Do not write code yet." Correcting a plan costs seconds. Correcting 300 lines costs an evening.
3. One piece at a time. "Write only the server module" is easier to check than a whole system.
4. Say what must not happen. "Never trust a price sent by the client" is the kind of rule assistants forget unless told.
Compare two prompts:
make a shop
Write a server Script for ServerScriptService. It listens to a RemoteEvent called BuyItem in ReplicatedStorage. The client sends only an item id. Look the price up in the ShopItems ModuleScript, check leaderstats.Coins on the server, and limit each player to one request per half second. Comment each check.
The second one names the script type, where it lives, what crosses the network and what must be checked. It is longer to write and far shorter to fix.
Sources
Checked against Roblox's documentation on . The lesson is in our own words; these pages are the source of truth.