#Minimap

1 messages · Page 1 of 1 (latest)

void laurel
#

Would this be an good solution to adding other players to the mini map where I use viewportframe.

cam.Parent = game.Workspace
cam.CameraType = Enum.CameraType.Scriptable
cam.FieldOfView = 5
ViewPortFrame.CurrentCamera = cam

local players = {}

for i, minimapObjects in pairs(map:GetChildren()) do
    minimapObjects:Clone().Parent = ViewPortFrame
end

game:GetService("RunService").RenderStepped:Connect(function()
    local camFr = CFrame.new(humRootPart.Position+Vector3.new(0, 3500, 0), humRootPart.Position)
    cam.CFrame = camFr
    ViewPortFrame:WaitForChild(Player.Name).Rotation = -humRootPart.Orientation.Y -90
    
    for player, gui in pairs(players) do
        if player.Character == nil then continue end
        local cFrame = player.Character:GetPivot()
        gui.Position = UDim2.new(cFrame)
    end

    
end)

local function PlayerAdded(player)
    local gui = ViewPortFrame.Arrow:Clone()
    gui.Name = player.Name
    gui.Parent = ViewPortFrame    
    players[player] = gui
end

local function PlayerRemoving(player)
    players[player]:Destroy()
    players[player] = nil
end

for i, player in ipairs(game.Players:GetPlayers()) do PlayerAdded(player) end
game.Players.PlayerAdded:Connect(PlayerAdded)
game.Players.PlayerRemoving:Connect(PlayerRemoving)```
signal cipher
#

Could just simulate it with a circle or smth