Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is print for?

Asked by 10 years ago

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

3 answers

Log in to vote
1
Answered by 10 years ago

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.

0
Thanks for helping! This works! iluvmaths1123 198 — 10y
0
No problem. TheeDeathCaster 2368 — 10y
Ad
Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago

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.

0
I knew that print was for output iluvmaths1123 198 — 10y
0
That's all it's for. HexC3D 830 — 10y
0
I said it was only used for output. HexC3D 830 — 10y
0
Does this need to be on a part iluvmaths1123 198 — 10y
View all comments (3 more)
0
Nope. HexC3D 830 — 10y
0
And also do i have to play the game or play the game without the player? iluvmaths1123 198 — 10y
0
Play the game with the player, but you can just print something else if you don't want the player. HexC3D 830 — 10y
Log in to vote
0
Answered by 10 years ago

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!

Answer this question