Quest System With Roblox Dialog?
Asked by
5 years ago Edited 5 years ago
1 | script.Parent.DialogChoiceSelected:connect( function (player, Dialog) |
2 | if Dialog.Name = = 'Dialog1' then |
3 | game.StarterGui.Quests.QuestsText.Text = "Test" |
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:
1 | local plr = game.Players.LocalPlayer |
2 | local starterGui = plr:WaitForChild( "PlayerGui" ) |
3 | script.Parent.DialogChoiceSelected:connect( function (player, Dialog) |
4 | if Dialog.Name = = 'Dialog1' then |
5 | starterGui.Quests.QuestsText.Text = "Test" |
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
1 | local starterGui = game:GetService( 'Players' ).LocalPlayer:WaitForChild( 'PlayerGui' ) |
2 | game.Workspace [ "SDMittensFan223/Dev" ] .Head.Dialog.DialogChoiceSelected:connect( function (player, Dialog) |
3 | if Dialog.Name = = 'Dialog1' then |
4 | starterGui.Quests.QuestsText.Text = 'Test' |
SDMittensFann23/Dev is my quest giver ;) thanks to the person who helped me with some research!