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

How do you add the players username to a custom npc gui?

Asked by 3 years ago

I'm trying to make a custom npc dialogue thing and I want to put the players username in the text but I can't figure it out for some reason. I have this so far which works

local TextLabel = script.Parent TextLabel.Text = game.Players.LocalPlayer.Name

But idk how to put it in the text for example,

script.Parent.text = ("Hi (Says their username) how are you doing)

Ik there's probably something similar to this post but it doesn't have what im looking for.

2 answers

Log in to vote
0
Answered by 3 years ago

Nvm I got it,

i just have to make 3 more variables, one for the part before the username and one after in a string. Then I make another variable which combines all them together ex.

sent1 = part1 .. TextLabel .. part2

Ad
Log in to vote
0
Answered by 3 years ago
Text = 'Hello ' .. game.Players.LocalPlayer.Name .. '!'

Answer this question