0

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

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.

0

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

0
Text = 'Hello ' .. game.Players.LocalPlayer.Name .. '!'