There is a GUI for displaying mini-maps
I have to put the models in the workspace into MapObjects
But I don’t know how to add a new player to MapObjects. How should I display it?
local MapObjects = game.Workspace.MapObjects
local Minimap = script.Parent:WaitForChild("Minimap")
local Arrow = Minimap:WaitForChild("Arrow")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Camera = Instance.new("Camera")
Camera.FieldOfView = 1
Camera.CameraType = Enum.CameraType.Scriptable
Camera.Parent = game.Workspace
Minimap.CurrentCamera = Camera
for i, Object in pairs(MapObjects:GetChildren()) do
Object:Clone().Parent = Minimap
end
game:GetService("RunService").RenderStepped:Connect(function()
local camCFrame = CFrame.new(HumanoidRootPart.Position + Vector3.new(0, 5000, 0), HumanoidRootPart.Position)
Camera.CFrame = camCFrame
Arrow.Rotation = -HumanoidRootPart.Orientation.Y - 90
end)