Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Quest System With Roblox Dialog?

Asked by 5 years ago
Edited 5 years ago
1script.Parent.DialogChoiceSelected:connect(function(player, Dialog)
2    if Dialog.Name == 'Dialog1' then
3        game.StarterGui.Quests.QuestsText.Text = "Test"
4 
5    end
6end)

So I am trying to make a quest system out of normal dialog (This script is the child of my dialog). I want it to make it so when you talk to the npc it makes the text of a quest gui switch from Quest: None to Test it dosent work any help?

Edit:

1local plr = game.Players.LocalPlayer
2        local starterGui = plr:WaitForChild("PlayerGui")
3script.Parent.DialogChoiceSelected:connect(function(player, Dialog)
4        if Dialog.Name == 'Dialog1' then
5            starterGui.Quests.QuestsText.Text = "Test"
6 
7        end
8    end)   

my new script on a local one and it still doesnt work ;/

ANSWERED: Answered my own question lol did some research local script doesn't run in a dialog so I moved it to starter gui and did this

1local starterGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
2game.Workspace["SDMittensFan223/Dev"].Head.Dialog.DialogChoiceSelected:connect(function(player, Dialog)
3        if Dialog.Name == 'Dialog1' then
4            starterGui.Quests.QuestsText.Text = 'Test'
5 
6        end
7    end)   

SDMittensFann23/Dev is my quest giver ;) thanks to the person who helped me with some research!

1 answer

Log in to vote
0
Answered by 4 years ago

ANSWERED: Answered my own question lol did some research local script doesn't run in a dialog so I moved it to starter gui and did this

1local starterGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
2game.Workspace["SDMittensFan223/Dev"].Head.Dialog.DialogChoiceSelected:connect(function(player, Dialog)
3        if Dialog.Name == 'Dialog1' then
4            starterGui.Quests.QuestsText.Text = 'Test'
5 
6        end
7    end)

SDMittensFann23/Dev is my quest giver ;) thanks to the person who helped me with some research!

Ad

Answer this question