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

How would I print 2 string values on the same line?

Might be a basic question but how would I print 2 different string values on the same line?

I'm wanting it to print the ClassName first then put a divider like " - " and finish it off with the Name of the object. So it would look something like "Model - GuestLIVE" or "Tool - Darkheart".

I've tried many different things and most errors come out as "attempt to perform arithmetic on a string value". Any help?

1 comment

0

Putting two strings together is called "concatenation" by the way.

1 answer

✓ Accepted answer

You can use this:

local model = script.Parent
print ( model.ClassName..' - '..model.Name )

Edit:

You can do a lot of stuff with strings, here is a wiki tutorial in case you want to learn more:

Tutorial.

1 comment

0

Worked! Thank you! :D

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