Basically I wanna make a gui with a dialouge system that fires a quest whenever the player accepts.
Although the script wont run, for some reason. I tried using prints but only the first two printed
print("hey guyssyfuihewfiuhewfiuwf")
local explorer = workspace["QUEST NPCS"].Part
print("explorer")
local gui = script.Parent.Parent.Parent.Parent.QuestDialouge.QuestDialogue
print("gui loolll")
local beforegui = script.Parent.Parent.Parent.Parent.QuestDialouge
print("beforegui looolll")
local db = false
print("Hey guys whats up today so im going to say hello")
explorer.Touched:Connect(function()
print("1")
if not db then
db = true
print("2")
beforegui.Enabled = true
print("3")
gui.NPCName.Text = "Part"
local chatText = "Hey! I need you to explore this island for me, I need approximately 500 studs explored before I can uncover the mystery of this island, I hear theres a strange thing below here! Will you help me?"
for i = 1, string.len(chatText) do
wait(0.025)
gui.Dialogue.Text = string.sub(chatText, 1, i)
script.Parent.Parent.Sound:Play()
end
gui.Option1.Text = "Sure!"
gui.Option2.Text = "Nope, I don't want to."
gui.Option1.Visible = true
gui.Option2.Visible = true
print("4")
db = false
end
end)
gui.Option1.MouseButton1Click:Connect(function()
gui.Option1.Visible = false
gui.Option2.Visible = false
local chatText = "Thanks man!"
for i = 1, string.len(chatText) do
wait(0.025)
gui.Dialogue.Text = string.sub(chatText, 1, i)
script.Parent.Parent.Sound:Play()
end
beforegui.Enabled = false
game.ReplicatedStorage.QuestRemotes.Walk500Studs.GiveQuest:FireServer()
wait(1)
local pathfinder = game.Players.LocalPlayer:WaitForChild("Quests"):WaitForChild("CurrentQuests"):WaitForChild("PathFinder")
local quest = script.Parent.Parent.Parent.Handler.QuestTemplate:Clone()
while wait(0.5) do
quest.ProgressText.Text = pathfinder:WaitForChild("QuestPercent").Value.."/500"
end
quest.QuestName.Text = pathfinder:WaitForChild("Quest").Value
quest.QuestTask.Text = pathfinder:WaitForChild("QuestTask").Value
quest.QuestGiver.Text = pathfinder:WaitForChild("QuestGiver").Value
quest.Reward.Text = "$"..pathfinder:WaitForChild("QuestReward").Value
quest.Parent = script.Parent.Parent.Parent.QuestsFrame.QuestsScrollingFrame
end)