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

How do you include the player's name in a GUI textbox?

Asked by
mrcool2 75
8 years ago

I do not know how to add code into a string value like this:

textbox.Text = "Hello there [game.Players.LocalPlayer.Name]!"

Due to the fact that whatever you put in there, it will just come out as text.. How can I make the script say the players name in the text?

2 answers

Log in to vote
1
Answered by 8 years ago

So close but all you needed to do a put two periods between the game.Players.LocalPlayer.Name bit!

textbox.Text = "Hello there "..game.Players.LocalPlayer.Name.." "

~UserOnly20Charcters, Hoped I helped you to answer your question! If you have any further question, don't hesitate to comment below!!

0
My god that was so simple, thank you! Merry Christmas! mrcool2 75 — 8y
Ad
Log in to vote
1
Answered by 8 years ago

you would concatonate the string like this

textbox.Text = "Hello there" ..  game.Players.LocalPlayer.Name

the .. combines 2 strings into 1

Answer this question