Roblox studio как создать npc

Обновлено: 04.07.2024

Dialogs are objects that allow you to create NPC characters that you can talk with, using a built-in interface. It’s very easy to use, and doesn’t even require scripting. However, you can add extra functionality with the event Dialog/DialogChoiceSelected .

You can use them to:
*Create NPC characters that reward you, or give you quests.
*Create help bots.
*Make talking enemies.
*Anything really, just use your imagination!

Creating a basic Dialog

Making the speech bubble

First, open Roblox Studio and create a new place. In explorer (View -> Explorer), select the part you want the speech bubble to appear above. Click Insert, select Basic Objects, and in the window that appears select Dialog. There’s your initial dialog object created! You won’t be able to see a speech bubble appear until you run the game with a character in (online or test solo).
In the properties window (View -> Properties), you will see the Dialog/InitialPrompt property. Change this to what you want the part to say as soon as you click on the speech bubble.

Hooray! You’ve got your first part to speak when you click on its icon!

Adding choices

So, you’ve got your speech bubble. That’s great and all, but you can’t talk to it, can you?
Select the original Dialog object and click Insert, then Basic Objects, and from the window select DialogChoice . In the properties window that you should have open, you will see a property called DialogChoice/UserDialog . This is the choice that the user will be given, not the name of it or any other properties. The property DialogChoice/ResponseDialog is what the part will say when the user selects that option, change it to what you want that to be.
You can add as many DialogChoice objects to the original Dialog object to give the user that amount of choices.

Adding more choices

Our Dialog now has several choices from the user to choose from, which result in the part giving a response. Additionally, we can add choices to those choices, creating a larger conversation with the part.
To do this, all you need to do is complete the previous step but instead of inserting DialogChoice objects into the original Dialog object, you insert them into an existing DialogChoice objects.

More properties and customisation

You can customise your Dialog further with additional properties. Change these with the properties window.
Note: These are only the properties that will have a visible effect in game.

Dialog/ConversationDistance : Set this to the maximum distance from which you can talk to the part. If you start within the distance and then walk out of it, the conversation will end.

Dialog/Purpose : These are the different icons that appear above the part for you to click on. Quest is a !, Help is a ? and Shop is a $.

Dialog/Tone : This is the color of the conversation - the speech bubble, and the choice GUI. Friendly is green, Neutral is blue and Enemy is red.

Example

Here’s an example of a Dialog being used.

Scripting

If you’re accomplished with Roblox Lua, you can add even more functionality to your NPC part. The scripting event DialogChoiceSelected holds two arguments - the player object and the object of the choice the player selects. It does not return the name of the choice. It fires whenever the player selects a choice.

That would print the name of the player and the name of the choice selected whenever the player selects a choice. You can’t localise it to a specific choice with the Dialog methods. If you want to make something happen whenever a player selects a specific choice, you need to give it a unique Name property and compare it with an if statement.

You can make something happen whenever a certain player selects a certain choice as well.

With this event, you can give characters quests, rewards, shop items and more!

Уроки по Roblox Studio №5 - Диалог

Author

Открываем ToolBox. Пишем "NPC". Запоминаем его название. Потом находим папку "Explorer". Ищем этого NPC. Потом у вас будет рядом с ним треугольник. Нажимаете на него. И находим модель "Head". Нажимаем на неё. И находим нашу старую, добрую папку "Insert Object". Ищем папку " Dialog". Нажимаем на неё. Находим папку в низу под названием "Propentions". И там пишем что хотим в папках "GoodBye dialog" и "User Dialog". Сейчас расскажу что они делают. User Dialog — это те слова, которые будет произносить игрок после NPC.

GoodBye Dialog - это те слова, которые будет произносить NPC перед игроком. Потом добавляем в папке "Dialog" папку "Dialog Choice". Все это мы делаем через папку "Insert Object". И пишем продолжение диалога. Их можно сделать кучу чтобы получился большой диалог. В моем случае я написал вот такое продолжение.

Это был последний урок этого лета. Я желаю всем удачи в учебном году. Получайте только 12! Ну а я буду прощаться! Ну а всем удачи мои строители! И всем пока!

How to custom NPCs on Roblox Studio?


Also do I have to buy the clothes I want to put on the NPCs?

Thx in advance for the help

New comments cannot be posted and votes cannot be cast


No. Just go to the page of the item. Then, click the url, and snag the number sequence. (Copy it)

Then, go to Studio. Opened “Advanced tools” (or whatever it’s called)

It’s symbol looks like a gear you would see in a clock.

Then, look up “Shirt” and “Pants” have the NPC humanoid selected, so they are put into the humanoid.

Then, paste the sequence into the shirt.

Have workspace, properties, and Advanced tools open and on your screen for this.

For faces, just copy the sequence of numbers on that face. Then, go to the humanoid. Scroll through workspace, and get to the “Head” part. Go to the decal symbol called “Face”. Now, paste the numbers into the decal ID box in Properties.

You can’t transport items over into Studio. Personally, I open Studio and grab a mesh from the toolbox. Delete all scripts that come with it, and just position it right on the humanoid with the move tool. Then, just group them together.

Basic Overview

Dialogs are actually very easy to use, with no scripting necessary for those of you who aren’t accomplished in Lua. They form like the image below:

DialogExample.PNG

The Dialog object displays the initial prompt, which then gives the user the choice of replies from the DialogChoice objects. The DialogChoice then gives the user the choice of replies from the DialogChoice objects inside itself.

Читайте также: