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

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

Asked by 6 years ago

This question already has an answer here:

How to make a dialog box say the 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.

Marked as Duplicate by hiimgoodpack, lukeb50, Void_Frost, and PyccknnXakep

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
az_iee 19
6 years ago
Edited 6 years ago

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!

Ad