Roblox Wiki
Roblox Wiki
This article is a stub. You can help the Roblox Wiki by expanding it.
Outdated information
The information on this article may be outdated. You can help the Roblox Wiki by updating it!

Debugging is the act of checking and testing one's code for errors. It is often the most important step and should be performed regularly.

Types of Debugging:

  1. Debug enhancement: Roblox has a built-in debugging system that can be used. More information here.
  2. Print debugging: Using the method print() of the global namespace, you put a print after each line of code you think is causing a problem. Where it stops printing is where you're blocked. For example, after starting a function you would write print("Function started") or for a loop you would type print("Loop"). Alternatively, you could use warn(). The key difference is that it warns in the console, instead of printing something.
  3. Verbose debugging: This method shows tons of output that tells the scripter what variables are set to, why loops ended and when functions stopped. This is generally the easiest way to debug.
  4. Live debugging: This consists of running your script on a script builder or Roblox Studio environment to draw out errors. To test this way you must deliberately try to cause scripting errors. A good way to do this is to use the Developer Console to run commands.