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

How to make a dialog box say a player's name?

For example, I'm trying to get an NPC to say something like, "Greetings, (player's name)!"

Is there a variable I can call to do that in the script? Better yet is there any way I can do it straight from the properties box? Thanks.

1 answer

Yes, there's a service you can use for this. Unless you're doing custom, here would be ROBLOX's chat bubbles:

NPC = npchere
ChatService = game:GetService("Chat") --just did this to make it easier.
ChatServce:Chat("Your text here",npc.PartYouWantBubbleToShowOn,Enum.ChatColor.Red) --pick from the colors red, green, or blue.

Want a player's name to appear? Well do the same thing but with a little fix!

NPC = npchere
ChatService = game:GetService("Chat") --just did this to make it easier.
ChatServce:Chat("Your text here"..player.Name,npc.PartYouWantBubbleToShowOn,Enum.ChatColor.Red) --pick from the colors red, green, or blue.

That should work! Good luck!

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