local a=200 local d=require(((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):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=d:GetResource("\069\120\116\101\114\110\097\108\085\116\105\108\046\078\101\120\117\115\073\110\115\116\097\110\099\101\046\078\101\120\117\115\079\098\106\101\099\116")local j=d:GetResource("\071\097\109\101\068\097\116\097\046\073\116\101\109\046\073\116\101\109\115")local D=d:GetResource("\083\116\097\116\101\046\073\110\118\101\110\116\111\114\121")local p=T:Extend()p:SetClassName("\080\108\097\121\101\114\073\110\100\105\099\097\116\111\114")function p.__new(j,d,T)j:InitializeSuper()local p=Instance.new("\073\109\097\103\101\076\097\098\101\108")p.BackgroundTransparency=1 p.Size=UDim2.new(.6/a,0,.6/a,0)p.AnchorPoint=Vector2.new(.5,.5)p.ZIndex=5 p.Parent=d j.PlayerIconBack=p local X=Instance.new("\073\109\097\103\101\076\097\098\101\108")X.BackgroundTransparency=1 X.Size=UDim2.new(1,0,1,0)X.ZIndex=5 X.Parent=p j.PlayerIconFront=X local G=Instance.new("\084\101\120\116\076\097\098\101\108")G.BackgroundTransparency=1 G.Size=UDim2.new(4,0,.7,0)G.Position=UDim2.new(.5,0,-0.7,0)G.AnchorPoint=Vector2.new(.5,0)G.Font=Enum.Font.Antique G.Text=T.Name G.TextColor3=Color3.new(1,1,1)G.TextScaled=true G.TextXAlignment="\067\101\110\116\101\114"G.ZIndex=5 G.Parent=p local B=T.Character j.Head=T.Character:WaitForChild("\072\101\097\100")j.Inventory=D.GetInventory(T);(coroutine.wrap(function()while B.Parent and j.PlayerIconBack.Parent do j:UpdatePosition()wait()end end))()j.InventoryChangedEvent=j.Inventory.InventoryChanged:Connect(function()j:UpdateTextures()end)j:UpdateTextures()end function p.UpdateTextures(a)local d=(a.Inventory:GetItem("\077\097\112\069\121\101\066\097\099\107")or{Name="\077\097\112\069\121\101\066\097\099\107\066\114\111\119\110"}).Name a.PlayerIconBack.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..tostring(j[d].TextureId)local T=(a.Inventory:GetItem("\077\097\112\069\121\101\070\114\111\110\116")or{Name="\077\097\112\069\121\101\070\114\111\110\116\068\101\102\097\117\108\116"}).Name a.PlayerIconFront.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047"..tostring(j[T].TextureId)end function p.UpdatePosition(d)d.PlayerIconBack.Position=UDim2.new((d.Head.CFrame.Z/100-.5)/a,0,((a-d.Head.CFrame.X/100)+.5)/a,0)end function p.Destroy(a)a.InventoryChangedEvent:Disconnect()a.PlayerIconBack:Destroy()end return p
--[[
TheNexusAvenger

Displays the location of a character on the map.
--]]

local FULL_MAP_SIZE_CELLS = 200


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

local NexusObject = ReplicatedStorageProject:GetResource("ExternalUtil.NexusInstance.NexusObject")
local ItemData = ReplicatedStorageProject:GetResource("GameData.Item.Items")
local Inventory = ReplicatedStorageProject:GetResource("State.Inventory")

local CharacterIndicator = NexusObject:Extend()
CharacterIndicator:SetClassName("PlayerIndicator")



--[[
Creates a character indicator.
--]]
function CharacterIndicator:__new(MapContainer,Player)
    self:InitializeSuper()

    --Create the image labels.
    local PlayerIconBack = Instance.new("ImageLabel")
    PlayerIconBack.BackgroundTransparency = 1
    PlayerIconBack.Size = UDim2.new(0.6/FULL_MAP_SIZE_CELLS,0,0.6/FULL_MAP_SIZE_CELLS,0)
    PlayerIconBack.AnchorPoint = Vector2.new(0.5,0.5)
    PlayerIconBack.ZIndex = 5
    PlayerIconBack.Parent = MapContainer
    self.PlayerIconBack = PlayerIconBack

    local PlayerIconFront = Instance.new("ImageLabel")
    PlayerIconFront.BackgroundTransparency = 1
    PlayerIconFront.Size = UDim2.new(1,0,1,0)
    PlayerIconFront.ZIndex = 5
    PlayerIconFront.Parent = PlayerIconBack
    self.PlayerIconFront = PlayerIconFront

    local PlayerNameText = Instance.new("TextLabel")
    PlayerNameText.BackgroundTransparency = 1
    PlayerNameText.Size = UDim2.new(4,0,0.7,0)
    PlayerNameText.Position = UDim2.new(0.5,0,-0.7,0)
    PlayerNameText.AnchorPoint = Vector2.new(0.5,0)
    PlayerNameText.Font = Enum.Font.Antique
    PlayerNameText.Text = Player.Name
    PlayerNameText.TextColor3 = Color3.new(1,1,1)
    PlayerNameText.TextScaled = true
    PlayerNameText.TextXAlignment = "Center"
    PlayerNameText.ZIndex = 5
    PlayerNameText.Parent = PlayerIconBack

    --Connect the events.
    local Character = Player.Character
    self.Head = Player.Character:WaitForChild("Head")
    self.Inventory = Inventory.GetInventory(Player)
    coroutine.wrap(function()
        while Character.Parent and self.PlayerIconBack.Parent do
            self:UpdatePosition()
            wait()
        end
    end)()
    self.InventoryChangedEvent = self.Inventory.InventoryChanged:Connect(function()
        self:UpdateTextures()
    end)
    self:UpdateTextures()
end

--[[
Updates the textures of the eye.
--]]
function CharacterIndicator:UpdateTextures()
    --Update the back.
    local EyeBackName = (self.Inventory:GetItem("MapEyeBack") or {Name="MapEyeBackBrown"}).Name
    self.PlayerIconBack.Image = "rbxassetid://"..tostring(ItemData[EyeBackName].TextureId)

    --Update the front.
    local EyeFrontName = (self.Inventory:GetItem("MapEyeFront") or {Name="MapEyeFrontDefault"}).Name
    self.PlayerIconFront.Image = "rbxassetid://"..tostring(ItemData[EyeFrontName].TextureId)
end

--[[
Updates the position of the indicator.
--]]
function CharacterIndicator:UpdatePosition()
    self.PlayerIconBack.Position = UDim2.new(((self.Head.CFrame.Z/100) - 0.5)/FULL_MAP_SIZE_CELLS,0,(FULL_MAP_SIZE_CELLS - (self.Head.CFrame.X/100) + 0.5)/FULL_MAP_SIZE_CELLS,0)
end

--[[
Destroys the indicator.
--]]
function CharacterIndicator:Destroy()
    self.InventoryChangedEvent:Disconnect()
    self.PlayerIconBack:Destroy()
end


return CharacterIndicator