[Solved] > Scripting - Does anyone know more scripts about printing?

Hey developers,
Do you know more scripting about printing then me?

print("Hello World!")
print("Hello".."World!")
print("Hello","World!")

:huh:image

2 Likes

Your question is extremely confusing, but I can tell you this wouldn’t work;

print("Hello",,"World!")

instead try;

print("Hello","World!")

There are several methods on printing if that’s what you mean. You can easily do the following to print;

print("Hello"..obj1..obj2) -- ect
print(obj1,obj2) -- ect
print("Hello")

I don’t think there’s more secrets to printing, this is the extreme basics of programming.

1 Like

Oh, i was wrong. I put the , wrong. I wanted to put , 1 not 2 but it put 2, Sorry.

1 Like

What do you mean by “script about printing”, print is just a built-in function, which littearly prints something in the output.

Here is more info if you want

print("Hello!", "World", 5, true) --you put multiple arguments into it, which is why it's called a variadic function
print("Hello!".."World") --this is called concatenating, meaning connecting multiple strings together
print("Hello!".." ".."World") --you can concatenate many things

--the ",," you used isn't valid syntax in lua, the "..." is a valid thing though, it's not related to strings though

What is your question exactly? Don’t make scripting support topics for no reason and just beacuse you can, thank you

2 Likes

Printing is mainly for debugging scripts, and making sure they work. I still do not understand where you’re coming from for your question, printing doesn’t have different functions.

Example:

print(50*100^3/4.." is some random math")

However, you can’t print tables alone, as it will print the table itself , not the objects in it. So if you where going to attempt that, you’d need a for index and value statement.

1 Like

That’s called a code block,

--stuff in here

image

Anyways have a good one, hope all your questions where answered.

2 Likes

Use the three ```symbol:

--This is a code block
print("Test")

Then the three dots are for concacting two strings (don‘t know how to it was write, bad englisch sorry), you should read the wiki

1 Like

That only works with two dots, and it’s concatenation. (The verb is spelled concatenate.) Three dots is for a function with a variable number of arguments, and is unrelated.

4 Likes

Sorry, i have want to write two, but write three. Three dots are for variadic functions, you have right.

2 Likes

Alright Solved! Love ya everyone!

print("Thanks for the help!","Have a nice day!")
print("GoodNight topic.")