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

How do I print text with a value?

Asked by
ax_gold 360 Moderation Voter
7 years ago

for example, I want to print something like level (x)

with x being the number. I already have a value named x, and I want to show x in the output with text in front of it. Does anyone have a way to do this?

1 answer

Log in to vote
1
Answered by 7 years ago
print("level ( "..yourvalue.Value.." )")
0
Thanks, it worked! ax_gold 360 — 7y
0
You can also separate values with commas (which also adds a space), like: print("level:", x) and if there's a lot of variables involved it's nice to know how to use string.format: http://lua-users.org/wiki/StringLibraryTutorial (Ctrl+F for "string.format"), ex: print(string.format("Level (%s/%s)", level, maxLevel)) chess123mate 5873 — 7y
Ad

Answer this question