Ask about script

Let’s say like for function like print , why you can do print “abcd” but you can’t do like print 123 without ().

The reason for this is because abcd has quotations. Those are a barrier for errors to enter. 123 has no barriers, so errors enter. Think of it like this, though. () are barriers. “” are barriers. Nothing ISN’T a barrier. I hope that this makes sense to you. Happy scripting!

Because 123 is an integer which returns an error since the print function only accepts strings. “123”, ‘123’ and [[123]] are strings. To find the type of something, use the typeof() function; print((typeof(“abcd”)) – returns string, print(typeof(123")) — returns integer. You can also print a white space by putting nothing between the (); print().

Print accepts any data type, both userdatas and native primitive types, not just strings.

Also @op, from the lua.org docs on calling functions,

“There is a special case to [calling functions]: If the function has one single argument and this argument is either a literal string or a table constructor, then the parentheses are optional”

https://www.lua.org/pil/5.html

It’s just something by design. There’s also no way to define a number other than literally defining it in some way, and as we know, variables can contain numbers if they don’t start with them so there’s no way for the Lua compiler to know whether you’re trying to reference a variable with the name “print123” or if you want the compiler to print 123.