#io need help creating a quest script
1 messages · Page 1 of 1 (latest)
** You are now Level 2! **
here is a simple
** You are now Level 1! **
script if u need it
local NPC = script.Parent
local ClickDetector = NPC:FindFirstChildOfClass("ClickDetector") or Instance.new("ClickDetector", NPC)
local Humanoid = NPC:WaitForChild("Humanoid")
local AnimationTrack = Humanoid:LoadAnimation(NPC:WaitForChild("Animation"))
ClickDetector.MouseClick:Connect(function(player)
AnimationTrack:Play()
local Dialog = Instance.new("Dialog")
Dialog.Parent = NPC
Dialog.InitialPrompt = "Help me?"
Dialog.Purpose = Enum.DialogPurpose.Quest
local Accept = Dialog:AddChoice("Accept Quest")
local Decline = Dialog:AddChoice("Not Now")
Dialog:Initiate(player.Character)
Dialog.ChoiceSelected:Connect(function(choice, selectedPlayer)
if selectedPlayer == player then
if choice == Accept then
local Quest = Instance.new("Folder")
Quest.Name = "MyQuest"
local Objective = Instance.new("StringValue", Quest)
Objective.Name = "Objective"
Objective.Value = "Complete the task!"
Quest.Parent = player
end
Dialog:Destroy()
end
end)
end)