xander5610
(Master_xander5610)
September 12, 2021, 7:26am
#1
I have three or so questions about npcs so here they are:
1. How do I make an npc teleport every player in the server when they all finish the dialog?
2. How do I change the dialog box to be cooler and match the rest of my game instead of the roblox default?
3. How do I put a hat or hair on the npc?
2 Likes
octav20071
(OctaViano)
September 12, 2021, 8:19am
#2
Do you use the default DialogChoices? If so, then I suggest looking at DialogChoiceSelected .
There are only 3 styles available. Purpose and Tone affect the style. I suppose.
Import it from Toolbox or the Avatar and then place it into the NPC.
3 Likes
xander5610
(Master_xander5610)
September 12, 2021, 8:21am
#3
Thanks! Most of this will help but I don’t know how to use DialogChoice because I can’t script.
octav20071
(OctaViano)
September 12, 2021, 8:23am
#4
It’s pretty simple actually. You can set the dialogs in the Properties tab and connect the event with the player and the dialog choice.
1 Like
xander5610
(Master_xander5610)
September 12, 2021, 8:24am
#5
Ok, I’ll try that next! Thank you!
xander5610
(Master_xander5610)
September 12, 2021, 9:34pm
#6
I tried this and I can’t figure out how to do it.
Dialogs shouldnt need scripting, unless they should do something. What cant you figure out?
xander5610
(Master_xander5610)
September 12, 2021, 9:40pm
#8
I can’t figure out how to write the script that teleports the player, here’s what I have so far:
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local placeId = 7460180431 -- replace here
workspace.Dialog.DialogChoiceSelected:connect(function(player,choice)
if choice.Name == "Yes!" then
TeleportService:Teleport(placeId)
end
end)
--placeid = 7460180431--
It’s in a local script under the dialog choice.
What part doesn’t work? Does it give any errors?
xander5610
(Master_xander5610)
September 12, 2021, 9:41pm
#10
There are no errors, I don’t know what doesn’t work.
It does say that there is an infinite yield though, I forgot where.
xander5610
(Master_xander5610)
September 12, 2021, 9:46pm
#12
Oh, ya. That’s probably the problem.
lol this is so off-topic now, how did we get from npcs to localscripts?
xander5610
(Master_xander5610)
September 12, 2021, 9:49pm
#14
Nope, still doesn’t work as a script.
xander5610
(Master_xander5610)
September 12, 2021, 9:49pm
#15
The script is for the npc so this is still on topic.
Ik. DialogChoiceSelected
only works as a localscript.
xander5610
(Master_xander5610)
September 12, 2021, 9:50pm
#17
Then how do I use it?!? Lua is so confusing…
Maybe put the localscript in the startercharacterscripts? Don’t give up!
xander5610
(Master_xander5610)
September 12, 2021, 9:52pm
#19
Ok, I’ll put it there, do I still need a script under the DialogChoice?
I dont think so… Probably not?