local Q=game:GetService("\080\108\097\121\101\114\115")local h=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local N=game:GetService("\083\116\097\114\116\101\114\071\117\105")local H=game:GetService("\071\117\105\083\101\114\118\105\099\101")local O=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local U=require((h:WaitForChild("\080\114\111\106\101\099\116")):WaitForChild("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101"))local T=U:GetResource("\071\097\109\101\068\097\116\097\046\081\117\101\115\116\046\081\117\101\115\116\115")local J=U:GetResource("\085\073\046\065\115\112\101\099\116\082\097\116\105\111\083\119\105\116\099\104\101\114")local t=(U:GetResource("\083\116\097\116\101\046\081\117\101\115\116\115")).GetQuests(Q.LocalPlayer)local P=(U:GetResource("\083\116\097\116\101\046\073\110\118\101\110\116\111\114\121")).GetInventory(Q.LocalPlayer)N:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)local b=Instance.new("\083\099\114\101\101\110\071\117\105")b.Name="\065\099\116\105\118\101\081\117\101\115\116\084\111\112\068\105\115\112\108\097\121"b.DisplayOrder=2 b.Parent=script.Parent local B=Instance.new("\073\109\097\103\101\076\097\098\101\108")B.BackgroundTransparency=1 B.Position=UDim2.new(1,0,0,-(H:GetGuiInset()).Y)B.Size=UDim2.new(.4,0,.4,0)B.AnchorPoint=Vector2.new(0,0)B.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\051\050\055\050\053\052\054\051"B.Parent=b J.new(b,1,function()B.SizeConstraint=Enum.SizeConstraint.RelativeYY end,function()B.SizeConstraint=Enum.SizeConstraint.RelativeXX end)local L=Instance.new("\073\109\097\103\101\076\097\098\101\108")L.BackgroundTransparency=1 L.Position=UDim2.new(.15625,0,.0703125,0)L.Size=UDim2.new(.09,0,.09,0)L.Parent=B local K=Instance.new("\084\101\120\116\076\097\098\101\108")K.BackgroundTransparency=1 K.Position=UDim2.new(.27,0,.05078125,0)K.Size=UDim2.new(.54,0,.1171875,0)K.Font=Enum.Font.Antique K.TextScaled=true K.TextColor3=Color3.new(.99607843137255,.76862745098039,.035294117647059)K.Parent=B local W=Instance.new("\084\101\120\116\076\097\098\101\108")W.BackgroundTransparency=1 W.Position=UDim2.new(.12,0,.18,0)W.Size=UDim2.new(.7,0,.18,0)W.Font=Enum.Font.Antique W.TextScaled=true W.TextColor3=Color3.new(.99607843137255,1.0,.87450980392157)W.Parent=B local g=Instance.new("\084\101\120\116\076\097\098\101\108")g.BackgroundTransparency=1 g.Position=UDim2.new(.12,0,.35,0)g.Size=UDim2.new(.68,0,.1,0)g.Font=Enum.Font.Antique g.TextScaled=true g.TextColor3=Color3.new(1.0,1.0,.63529411764706)g.Parent=B local function u()local Q=t.QuestData.SelectedQuest if Q then(O:Create(B,TweenInfo.new(.5),{AnchorPoint=Vector2.new(.905,0)})):Play()else(O:Create(B,TweenInfo.new(.5),{AnchorPoint=Vector2.new(0,0)})):Play()return end local h=T[Q]if not h then return end L.Image=t:GetStatusIcon(Q)K.Text=Q W.Text=h.Description g.Text=t:GetStatusText(Q)end u()t.QuestsChanged:Connect(u)P.InventoryChanged:Connect(u)
--[[
TheNexusAvenger

Displays the active quest for the player.
--]]

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local GuiService = game:GetService("GuiService")
local TweenService = game:GetService("TweenService")

local ReplicatedStorageProject = require(ReplicatedStorage:WaitForChild("Project"):WaitForChild("ReplicatedStorage"))

local QuestsData = ReplicatedStorageProject:GetResource("GameData.Quest.Quests")
local AspectRatioSwitcher = ReplicatedStorageProject:GetResource("UI.AspectRatioSwitcher")
local Quests = ReplicatedStorageProject:GetResource("State.Quests").GetQuests(Players.LocalPlayer)
local Inventory = ReplicatedStorageProject:GetResource("State.Inventory").GetInventory(Players.LocalPlayer)



--Disable the player list.
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)

--Create the ScreenGui.
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "ActiveQuestTopDisplay"
ScreenGui.DisplayOrder = 2
ScreenGui.Parent = script.Parent

--Create the container.
local Background = Instance.new("ImageLabel")
Background.BackgroundTransparency = 1
Background.Position = UDim2.new(1,0,0,-GuiService:GetGuiInset().Y)
Background.Size = UDim2.new(0.4,0,0.4,0)
Background.AnchorPoint = Vector2.new(0,0)
Background.Image = "rbxassetid://132725463"
Background.Parent = ScreenGui

AspectRatioSwitcher.new(ScreenGui,1,function()
    Background.SizeConstraint = Enum.SizeConstraint.RelativeYY
end,function()
    Background.SizeConstraint = Enum.SizeConstraint.RelativeXX
end)

local PumpkinIcon = Instance.new("ImageLabel")
PumpkinIcon.BackgroundTransparency = 1
PumpkinIcon.Position = UDim2.new(40/256,0,18/256,0)
PumpkinIcon.Size = UDim2.new(0.09,0,0.09,0)
PumpkinIcon.Parent = Background

local QuestName = Instance.new("TextLabel")
QuestName.BackgroundTransparency = 1
QuestName.Position = UDim2.new(0.27,0,13/256,0)
QuestName.Size = UDim2.new(0.54,0,30/256,0)
QuestName.Font = Enum.Font.Antique
QuestName.TextScaled = true
QuestName.TextColor3 = Color3.new(254/255,196/255,9/255)
QuestName.Parent = Background

local QuestDescription = Instance.new("TextLabel")
QuestDescription.BackgroundTransparency = 1
QuestDescription.Position = UDim2.new(0.12,0,0.18,0)
QuestDescription.Size = UDim2.new(0.7,0,0.18,0)
QuestDescription.Font = Enum.Font.Antique
QuestDescription.TextScaled = true
QuestDescription.TextColor3 = Color3.new(254/255,255/255,223/255)
QuestDescription.Parent = Background

local QuestStatus = Instance.new("TextLabel")
QuestStatus.BackgroundTransparency = 1
QuestStatus.Position = UDim2.new(0.12,0,0.35,0)
QuestStatus.Size = UDim2.new(0.68,0,0.1,0)
QuestStatus.Font = Enum.Font.Antique
QuestStatus.TextScaled = true
QuestStatus.TextColor3 = Color3.new(255/255,255/255,162/255)
QuestStatus.Parent = Background



--[[
Updates the display depending on
the selected quest.
--]]
local function UpdateDisplay()
    --Hide or show the display depending on if a quest is selected.
    local SelectedQuestName = Quests.QuestData.SelectedQuest
    if SelectedQuestName then
        TweenService:Create(Background,TweenInfo.new(0.5),{
            AnchorPoint = Vector2.new(0.905,0),
        }):Play()
    else
        TweenService:Create(Background,TweenInfo.new(0.5),{
            AnchorPoint = Vector2.new(0,0),
        }):Play()
        return
    end

    --Return if a quest doesn't exist.
    local QuestData = QuestsData[SelectedQuestName]
    if not QuestData then
        return
    end

    --Update the display.
    PumpkinIcon.Image = Quests:GetStatusIcon(SelectedQuestName)
    QuestName.Text = SelectedQuestName
    QuestDescription.Text = QuestData.Description
    QuestStatus.Text = Quests:GetStatusText(SelectedQuestName)
end



--Connect updating the display.
UpdateDisplay()
Quests.QuestsChanged:Connect(UpdateDisplay)
Inventory.InventoryChanged:Connect(UpdateDisplay)