Roblox Wiki
Advertisement
Roblox Wiki

Introduction

Print is one of the basic functions of ROBLOX scripting; it is a very simple method with a tuple of parameters. The method shows in the ROBLOX Studio's output box whatever string is entered in the parameters, or if there is a polynomial within the parameters, whatever the polynomial equals. For example, Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would show in the output:

Hello, world!

But also, Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would make

Hello World

Strings vs. Polynomials

If you want to output exactly what is typed within your parameter, you enter the text within double quotes within the parentheses, however if you are trying to make RBLX.lua calculate a polynomial, then do not use double quotes, and simply enter your polynomial in the parentheses. As an example:

Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would output:

1+1

But Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would output:

2

Use of Variables

Variables can also be inputted into the parameters, for example: Lua error in Dev:Delimited tag at line 17: No tag text provided.?. 

Would output:

Hello World!

Note that the quotes rule still applies as before, so Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would output:

2

In addition... Lua error in Dev:Delimited tag at line 17: No tag text provided.?. Would output:

6

Usage

As the print function does not actually interact with the Workspace light iconWorkspace dark iconWorkspace service, scripters mainly use this function for debugging to check if and when a certain action in their script has been performed, and, if one of the actions failed, which action in the script failed.





















Advertisement