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

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.

2 answers

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

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

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