How to make npc in roblox studio
How to make npc in roblox studio
Moving NPCs Between Points
NPCs, or non-player characters, can add a lot of depth to a game. NPCs can be enemies for players to fight, colorful characters that players can talk to and interact with, and more.
Sometimes an NPC can stand in one place, like a shopkeeper working at a small in-game shop. In other cases, an NPC will look much less robotic (and more human!) if it moves around, even if it’s basic movement between two or more points.
Moving to a Point
A simple way to move an NPC is with the Humanoid object, a special object that gives a Model|model the functionality of a character, even if it doesn’t look human. This allows the model to physically move around the place and interact with objects in it.
Consider this zombie. Zombies aren’t very smart, so we can make it walk in a straight line without worrying if anything is in the way.
For convenience, the green flag model inside the game has been named GreenFlag. We’ll use it as the first destination for the zombie to walk to. Consider this example:
In this basic code, we find the Zombie model in the workspace, get its Humanoid object, set the green flag as the destination point, and then tell the zombie to walk toward it using the Humanoid/MoveTo|MoveTo() method.
Moving to Additional Points
Moving an NPC to one point is cool, but what about moving it in a series of points? You could script a bunch of Humanoid/MoveTo|MoveTo() and wait() commands in a sequence, but that’s tedious to code.
A better solution is to use the Humanoid/MoveToFinished|MoveToFinished event. This event lets you pause a script until the Humanoid/MoveTo|MoveTo() action is completed and the NPC reaches its destination. Then you can continue running the script, moving the NPC onward to another point or back to its original point.
NPC Dialog Boxes
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!
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:
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.
Creating a basic Dialog
Making the speech bubble
Hooray! You’ve got your first part to speak when you click on its icon!
Adding 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.
Example
Here’s an example of a Dialog being used.
Scripting
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 с любым НПС. С помощью диалогов можно будет создать настоящий сюжет со своей историей или использовать диалоги для объяснения правил, заданий и квестов. Создать сюжет можно при помощи базовых функций которые встроены в Roblox Studio.
Как создать диалог с НПС
В первую очередь пишем в поиск npc и выбираем подходящего
Кликните по НПС и выберите Head в меню справа
В нашем случае в Head лежит сразу два фала Dialog. Удаляем один из них.
Выберите файл Dialog и напишите в строке InitialPrompt приветственное сообщение от НПС (то что он скажет если вы начнете с ним диалог)
Нажмите кнопку сразу после Dialog и добавьте DialogChoice для того что бы продолжить диалог с НПС и создать фразы которыми вы будите отвечать
Выберите DialogChoice и напишите фразу которую должен будет ответить игрок в строке UserDialog, а в строке ResponseDialog напишите фразу которую должен будет сказать НПС
Далее можете прикрепить к DialogChoice еще один DialogChoice и прописать следующие фразы для того что бы продолжить диалог до бесконечности
А вот как это будет выглядеть
Дополнительные свойства диалогов
Dialog.ConversationDistance : Установите максимальное расстояние, с которого вы можете разговаривать с НПС. Если вы начнете на расстоянии, а затем выйдете из него, разговор закончится.
Dialog.Tone : Это цвет разговора — речевой пузырь и выбор графического интерфейса. Дружественный — зеленый, нейтральный — синий, а враг — красный.
Вы можете добавить несколько DialogChoice к Dialog (на одном уровне вложенности) для того что бы у игрока было несколько вариантов ответа. Вот как это работает:
Так же вы можете добавить еще больше функциональности если хорошо разбираетесь в Roblox Lua. С помощью функций и скриптов вы сможете выводить имена Игроков в диалогах, отображать какие то характеристики и многое другое. Так например этот скрипт отобразит имя игрока и название его выбора в диалоге.
HOW TO MAKE AN IDLE NPC IN ROBLOX STUDIO! (Easy) 2020
Показать панель управления
Комментарии • 105
wondering if alreadypro’s character load in works with this! i tried and followed the instructions perfectly, but i think there might be something in alreadypro’s plugin which blocks the animation from playing! (it isn’t anchored by the way!) think i could have some advice? thanks!
yea, same for me
Thank you soooo much! This is excactly what I was looking for, but couldn’t really put it into words!
(U just got a like)
@Foxman260 idk what you pressed but i had no idea
Elle Henry thanks!
I was actually searching this and i finally found it! Thank you so much man 😉
Btw is it possible to use another animation?
@MX Yeah and I already did it
@Ecárteo hello may i ask the npc idol animation is what you want to change?
Ecárteo clip-share.net/video/tGvOUy-WsN0/видео.html you dont need to do the tool part just make your on idle and put a script copy the script in the vid an put an animation in your gui and put the animation id of the animation you made
Hey Ecárteo Im sorry I cant do the vid yet I had to rest my eyes because I was using gadgets for like 3 hours but I’ll share you a vid that might help you
hi! this is a very nice video, but is there a way to add pre-made animations? for instance, how do i add the robot idle on an npc?
Jareau yes but i’ll make a new video for that
How To Make NPCs In Roblox Studio!
Kích thước video:
Hiển thị các điều khiển trình phát
NHẬN XÉT • 391
There’s controls for this:
Select- ctrl 1
Move- ctrl 2
Scale- ctrl 3
Rotate- ctrl 4
Transform- ctrl 5
Hope this helps! 😀
thx bro rlly appreciated
Great video, very well explained.
Thank you FireWolf-Gaming for helping me figure out what to do (I can understand you unlike everyone else on youtube) you have earned a subscriber. : )
This is actually very helpful thanks
Thx for making this awesome tutorial, it helped me alot
this helped a lot thank you so much!
Thanks helped out a lot and also can you tell me and others in another video how to make the characters move and interact if you currently know how if you don’t you can probably look it up I know I will
Thank You Really Helpful 😀
Wow! This helped alot! Tysm! 🙂
Thank you for showing how to make NPC really helped me in building games
Can you make a tutorial to make our character morph into something we like? (Such like a game called Pokemon Fighters EX) This would be helpful!
This will really help for my next game, thank you so much!!
Thanks! This really helped me out!
Hello, i have a little problem. I’ve been creating a character (I want it to be able to move and I know I can’t anchor it because, if i do, it won’t move) and it’s always falling apart, i can’t find a way to avoid that (Yeah, i tried joining the thing but i couldn’t join the head with the body and it just kept falling apart). Please, someone help me.