#io need help creating a quest script

1 messages · Page 1 of 1 (latest)

cosmic jacinth
#

essenstialy when the player click the npc it starts a dialog then gives the quest with 2 options i also need to make the animation i made for the npc to play once clicked

thorny gustBOT
#

studio** You are now Level 2! **studio

leaden karma
#

here is a simple

thorny gustBOT
#

studio** You are now Level 1! **studio

leaden karma
#

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)

cosmic jacinth
#

where do i put this

#

@leaden karma

grave blade
#

In the NPC

leaden karma
#

script might not be perfect tho

#

u need to tweak it

grave blade
#

Also this is not the channel to ask people to make scripts for you. You got lucky someone did it for you this time, but this channel is made to request help on a script you have.

#

Rule 4