Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What does print hello world means?

Uh what does print Hello World does, like when you play it doesnt do anything or what da heck is dat

3 comments

0

Very good question.

1

That's an excellent question one filled with awe and wonder.

0

Hmm ive been developing for 2 years now i still cant figure it our either very good point

2 answers

Hello.

In the output window it displays "Hello world!".

To open the output window in Studio,you would click View > Output To open the output in-game,you would press F9.

When opening a script the default code in local and server scripts isprint("Hello World"). What does this mean exactly? It takes the string "Hello World" and prints it in the output. You could also do print('Hello world') print 'hello world' or even print "hello world" . BUT DO NOT do print(Hello World) as this will either error or most likely print nil. Without putting the parenthesis the script assumes that "Hello World" is a variable and when it sees it is not it returns nil in the output. Most scripters use this to test their code to see if it works, personally I find it a life saver at times when I do not know where the error is happening. For example:

script.Parent.Touched:connect(function(hit)
      print("The part has been touched!")
local hum = hit.Parent:FindFirstChild("Humanoid")
     print("Finding Humanoid...")
 if hum ~= nil then
print("Testing if it is there")
hit.Parent.Character.Humanoid:Remove()
    print("I removed the torso")
     end
end)

When you look at the code and don't know where you had your error the print would tell you where. In this case, obviously, it is hit.Parent.Character.Humanoid:Remove() . But, in more complicated code will come to use. If you have any questions comment on my answer, but if this did help you don't forget to give a thumbs up and accept my answer! Glad to help!

2 comments

1

print(Hello World) would not print "nil"; it would throw a syntax error. You cannot have two variable names next to each other, that doesn't mean anything in Lua.

1

Also, stop using Remove, please. It's deprecated. It's so ugly ;~;

This discussion is preserved as it was. New answers, comments, and votes are closed.