#minimap
1 messages · Page 1 of 1 (latest)
local minimapGui = script.Parent
local minimapFrame = minimapGui:WaitForChild("MinimapFrame")
local directionArrow = minimapFrame:WaitForChild("DirectionArrow")
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local rs = game:GetService("RunService")
local player = players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
local currentCamera = Instance.new("Camera")
currentCamera.Name = "MinimapCamera"
currentCamera.FieldOfView = 1
currentCamera.CameraType = Enum.CameraType.Scriptable
currentCamera.Parent = workspace
minimapFrame.CurrentCamera = currentCamera
local function CloneToMinimap(obj)
if obj:IsA("BasePart") or obj:IsA("MeshPart") then
local clone = obj:Clone()
clone.Anchored = true
clone.CanCollide = false
clone.Parent = minimapFrame
elseif obj:IsA("Model") then
local clone = obj:Clone()
if not clone.PrimaryPart then
clone.PrimaryPart = clone:FindFirstChildWhichIsA("BasePart")
if not clone.PrimaryPart then
end
end
if clone.PrimaryPart and obj.PrimaryPart then
clone:SetPrimaryPartCFrame(obj:GetPrimaryPartCFrame())
end
for _, descendant in ipairs(clone:GetDescendants()) do
if descendant:IsA("BasePart") then
descendant.Anchored = true
descendant.CanCollide = false
end
end
clone.Parent = minimapFrame
end
end
local minimapObjectsFolder = workspace:WaitForChild("MiniMap")
for _, minimapObject in ipairs(minimapObjectsFolder:GetChildren()) do
CloneToMinimap(minimapObject)
end
minimapObjectsFolder.ChildAdded:Connect(function(newObject)
CloneToMinimap(newObject)
end)```
rs.RenderStepped:Connect(function()
local camCFrame = CFrame.new(hrp.Position + Vector3.new(0, 6000, 0), hrp.Position)
currentCamera.CFrame = camCFrame
directionArrow.Rotation = -hrp.Orientation.Y - 90
end)```
should i add a imagelabel ? and how
i need a expert pls