generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Need help with Dialogue script that makes NPC speed = 0

Previous Thread :: Next Thread 
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
12 Feb 2015 10:27 PM
Hello fellow scripters! I need help with making a script that would make an NPC's speed to 0 when you click on the dialogue bubble chat. I can't seem to get it right.
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
12 Feb 2015 10:36 PM
So I already have the "animate" script and the "Dialogue" bubble script inside "head" of the NPC model.

I'm not sure what the next step is when trying to make this script. Help would greatly be appreciated!
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
12 Feb 2015 10:54 PM
Send me the model i'll just do it for you.
Report Abuse
wrightracer3n is not online. wrightracer3n
Joined: 09 Nov 2011
Total Posts: 964
12 Feb 2015 11:36 PM
You can use the InUse property of Dialog to check when the dialog is being used and if so, change the NPC Humanoid WalkSpeed to 0

- WrightRacer3n
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
13 Feb 2015 12:16 AM
Here's the model:

http://www.roblox.com/walking-NPC-item?id=215468059
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
13 Feb 2015 06:37 PM
I'm still having trouble, can anyone help me?
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 08:11 PM
I've ALMOST figured it out I think!


function script.Parent.DialogChoiceSelected:connect(talk)
Parent:findFirstChild("Humanoid")
H.Parent:findFirstChild("Torso").Anchored = true
end


i don't know if I created the function correctly. I want the NPC's torso to become anchored so it would stop moving when being talked to. The script is inserted under "dialog".
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 08:36 PM
im so tired, i've tried different scripts and tested it several times and i still can't get it D:
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
15 Feb 2015 08:40 PM
i think that the dialogchoiceselected event only fires once the user selects a response, not when they first click on the chat bubble

that would make it impossible to do what you are trying to do
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 08:42 PM
AH thank you for the reply!

I'll try a different method and see if it'll work!
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 08:58 PM
Okay, this time I inserted the script under the NPC model itself (and not dialog).

Since I already have a "move to" script, I implemented the code within that.


model = script.Parent.Parent
hum = script.Parent.Humanoid
torso = script.Parent.Torso
while true do

if script.Parent.DialogSelected:connect()then
torso.Anchored = true
end

if model.PointA ~= nil then
[...] <--- big line of code for "move to" script


now the problem is that the NPC is already anchored and is now stationary. I think I'm missing something in this code:

if script.Parent.DialogSelected:connect()then
torso.Anchored = true
end
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 09:16 PM
function talk()
script.Parent.Anchored = true
wait(10)
end



okay I changed the "if script.parent.DialogSelected" part to this one

The anchor problem is gone but the NPC still won't stop walking whenever I select its dialog bubble. Any ideas? I feel like I'm really close to solving my issue
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 09:42 PM
can anyone help me? D:

I've been working on it this afternoon and I can't seem to make it work! It's really frustrating >:O
Report Abuse
K7Q is not online. K7Q
Joined: 23 Mar 2013
Total Posts: 5546
15 Feb 2015 09:50 PM
function OnClick()
as
as
asd
as
d
asd
asd
a
sd
asd
asd
as
d
asd
as
da
s
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
15 Feb 2015 11:59 PM
I don't think the onClick function works for Dialog?
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
16 Feb 2015 09:21 AM
I've edited the scripts in the NPC model back to normal and added a new script with this code:

script.Parent.Torso.Anchored = true

I could tell that the NPC's torso became anchored because when I tried to push the NPC it wouldn't move. Now my problem is that I want this to occur whenever a player selects its Dialog bubble. Any ideas?
Report Abuse
Kino4500 is not online. Kino4500
Joined: 07 Dec 2007
Total Posts: 4307
16 Feb 2015 06:14 PM
anyone?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image