About the Editor
Our In-Game Editor
Section titled “Our In-Game Editor”Writing code in a normal TextBox can be annoying. Especially for mobile players, it can be incredibly challenging.
The Plant with Coding editor features its own LAU editor with specialized syntax highlighting and tools to make coding easier for all players.
General Editor Keybinds
Section titled “General Editor Keybinds”PC Players
Section titled “PC Players”For PC players, the editor includes several shortcuts to speed up your workflow:
| Action | Keybind |
|---|---|
| Change Font Size | Hold Alt + Scroll Mouse Wheel |
| Navigate Suggestions (Up) | Num 1 |
| Navigate Suggestions (Down) | Num 4 |
| Complete Suggestion | TAB |
| New Line | ENTER |
Mobile Players
Section titled “Mobile Players”Mobile players may find it very difficult to write code. This may vary depending on the keyboard usage of certain tablet and phone brands.
On mobile, you can get help using support buttons at the top:
- Focus Button: Forces the keyboard to open and focus on a specific line
- New Line Support: Helps with inserting new lines during code entry
To learn how to write code within the Editor, you can visit the Scripts page.
The Output Window
Section titled “The Output Window”The Output window is where your written code communicates with the world. We use this panel to:
- Understand what your code is doing at that moment
- Check the values of variables
- Debug errors
Printing Messages
Section titled “Printing Messages”You can send messages to the Output panel using the print commands:
print("Hello World") -- Prints to OutputError Types and Reporting
Section titled “Error Types and Reporting”When there is a problem with your code, you may see red text in the Output panel. Some errors are related to your code, while others may be system-related:
Nonsensical Errors
Section titled “Nonsensical Errors”Color: Yellow - If you are receiving a strange error even though your code looks correct, this might be an engine error.
Low Critical Engine Errors
Section titled “Low Critical Engine Errors”Color: Orange - This is a lower severity error indicating an issue within the StdLib. Sometimes it’s caused by a logical mistake in your code, but other times it might be a genuinely illogical system error. If you find it nonsensical, please report it to us.
CRITICAL ENGINE FAILURE
Section titled “CRITICAL ENGINE FAILURE”Color: Red - This is a SERIOUS situation that disrupts the functioning of the system. If you receive this type of warning, please report it to us immediately.
Scripts
Section titled “Scripts”To create, delete, start writing, and run code, we need to get familiar with the SCRIPTS section.
Creating a New Script
Section titled “Creating a New Script”To create a new script in the SCRIPTS section:
- Press the button at the bottom with the text + Create New Script
- You’ll be taken to the Script Creation panel
Script Types
Section titled “Script Types”There are 2 different script types to write your code:
Normal Scripts (.lau)
Section titled “Normal Scripts (.lau)”Normal Scripts are the main brain of your drone. These are files that run from top to bottom and execute commands directly when you start the game. Their extensions are .lau.
Module Scripts (.laum)
Section titled “Module Scripts (.laum)”Module Scripts do not run on their own. They store functions, special variables, and libraries inside them. They wait to be called by another script using the req() command. Their extensions are .laum.
Module Script Usage Example:
local farmingModule = req("FarmingOperations.laum")farmingModule.cropAll() -- etcUsing Module scripts provides a great advantage for keeping your code more organized and avoiding writing the same code over and over again.
Naming and Configuration
Section titled “Naming and Configuration”When naming a script:
- Use a single-word name consisting of up to 30 characters
- You can also change its color - the color is entirely your choice
Running Your Scripts
Section titled “Running Your Scripts”To run the scripts you’ve created, place them into the Drone module.
To edit a script, press the Edit button below the created script to open your Editor.
Learning the Language
Section titled “Learning the Language”Don’t worry if you are programming for the first time. The language is explained step-by-step, so everything you can do won’t overwhelm you.
The syntax is also a language called Lau, similar to Roblox’s own Lua language (Lua / Lau), so your learning won’t go to waste.
If you already know Lua, that’s no problem; you can skip the early stages of the game to quickly reach more interesting things.
Example Commands
Section titled “Example Commands”Currently, there are several drone commands available:
drone.crop() -- Cuts plants from the rootdrone.harvest() -- Plucks fruit from fruit-bearing plantsdrone.doFlip() -- Makes the drone flipThese are function calls. You can think of a function as an executable command. You execute it using () parentheses.
Example - Multiple Statements:
drone.crop()drone.doFlip()drone.crop()You can think of your code as a series of statements. You can run multiple statements sequentially like this.