Skip to content

About the 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.


For PC players, the editor includes several shortcuts to speed up your workflow:

ActionKeybind
Change Font SizeHold Alt + Scroll Mouse Wheel
Navigate Suggestions (Up)Num 1
Navigate Suggestions (Down)Num 4
Complete SuggestionTAB
New LineENTER

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 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

You can send messages to the Output panel using the print commands:

print("Hello World") -- Prints to Output

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:

Color: Yellow - If you are receiving a strange error even though your code looks correct, this might be an engine error.

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.

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.


To create, delete, start writing, and run code, we need to get familiar with the SCRIPTS section.

To create a new script in the SCRIPTS section:

  1. Press the button at the bottom with the text + Create New Script
  2. You’ll be taken to the Script Creation panel

There are 2 different script types to write your code:

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 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() -- etc

Using Module scripts provides a great advantage for keeping your code more organized and avoiding writing the same code over and over again.

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

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.

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.

Currently, there are several drone commands available:

drone.crop() -- Cuts plants from the root
drone.harvest() -- Plucks fruit from fruit-bearing plants
drone.doFlip() -- Makes the drone flip

These 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.