How to print something with strings and variables?

If you don’t get what I mean. Here is an example:
image
for the second line i get
image
but for the 3rd line i get

I don’t know why it’s like that cuz it already printed my name and all i added was a string. Can you help? Thanks in advance

4 Likes

When you print an instance like player by itself tostring() is automatically done on it.This is done with luau built in metatable

However when you concatenate with “…” it doesn’t so you will need to use tostring() to convert it to a string

1 Like

Um…I just started scripting so… Can you like give an example :grin:

Chang the player In the second print to player.Name. It’ll fix it. As your combining the player instance it self. Not the name. So just add .name at the end to fix

7 Likes

Thanks!!! It worked. (characters)

No problem. Glad i could help.

1 Like