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

What is print for?

I don't know what print does all i use for it is for fun.Can you please help?

3 answers

✓ Accepted answer

print() prints a string into the Output, for example, if I were to make a script like this;

-- Sorry if this wasn't helpful --

if not workspace:FindFirstChild("TheeDeathCaster")then
repeat wait(0)until workspace:FindFirstChild("TheeDeathCaster")
print("Cool Story Bro.")
end

The Output would bring up Cool Story Bro.

2 comments

0

Thanks for helping! This works!

0

No problem.

You can use print() to make sure things work like let's say.

val = 1
game.Players.PlayerAdded:connect(function(plr)
if val == 1 then
print(plr.Name) -- Print's player name




end
end)

In that case I use to check if my if statements work or other pieces of script, Remember print() is only used for output.

7 comments

0

I knew that print was for output

0

That's all it's for.

0

I said it was only used for output.

0

Does this need to be on a part

0

Nope.

0

And also do i have to play the game or play the game without the player?

0

Play the game with the player, but you can just print something else if you don't want the player.

The print shows the message you put inside of the "print("")" on the output. So if I put

print("Hello there ROBLOX")

The output would show "Hello there ROBLOX". You can also make it print in certain circumstances like this.

if 2*2 == 4 then
print("All is right in the world!")
else if 2*2 ~= 4 then
print("Something has gone wrong GRAB A HELMET!")
end

I hope this helped :) Remember to check wiki.Roblox.com!

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