Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I'm having problems with a Dialogue Choice script, help please?

So... I put a dialogue box on a NPC, and then i added a script into it. The main reason for i doing that was to make a specific dialogue choice move me to another place, but my script just don't work, i've tried everything.. Help please?

Script:

-- pizza is the name i've gave to the Dialogue Choice that was supposed to move me to another place

  script.Parent.DialogChoiceSelected:connect(function(player, choice)
		if (choice == script.Parent.DialogChoice.DialogChoice.DialogChoice.DialogChoice.pizza) 			then
    player.Character:MoveTo(Vector3.new(19, 0.5, -65)) 

	end
end)    

Sorry for any grammar mistake.

Also i'm pretty new to Lua Scripting, so don't bully me, lol.

1 answer

Yeah... This was the most annoying bug that I ever faced. But I found a solution for this...

So Script doesn't work for this, you have to put all code in a LocalScript... So write this code

local dialog = workspace.Dummy.Head:WaitForChild("YOUR DIALOG NAME")

dialog.DialogChoiceSelected:Connect(function(player, choice)
	if choice.Name == "DIALOG NAME" then
		--Do stuff
	end
end)

If there are anymore problems, I'd be glad to help...

Remember to write that in a LOCALSCRIPT

If this works, please upvote and make this the solution!

3 comments

0

I've made everything you told me to,but my script still doesn't work..i rewrited it, copy and pasted it, i even changed the Dialog's Choices name... But the result is exactly the same: Nothing happens. My Script:                                                                                       local dialog = workspace.It.Head:WaitForChild("pizza")                                               

0

Try putting print("It's working") in the if statement, and look at the output when you click the dialog. And check if it says "It's working"

0

Nope, not even a word.

This discussion is preserved as it was. New answers, comments, and votes are closed.