Minimap 3D fixed
Key RequiredUniversal

Minimap 3D fixed

Universal Scriptstyearstyear 539 views 55 executesUpdated Feb 24, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•218 lines (5385 chars)
local Players=game:GetService("Players")
local RunService=game:GetService("RunService")
local Workspace=game:GetService("Workspace")
local Lighting=game:GetService("Lighting")
local UserInputService=game:GetService("UserInputService")

local player=Players.LocalPlayer
local guiPlayer=player:WaitForChild("PlayerGui")

getgenv().GUI_POSITIONS=getgenv().GUI_POSITIONS or {}
getgenv().GUI_LOCKS=getgenv().GUI_LOCKS or {}

local ScreenGui=Instance.new("ScreenGui")
ScreenGui.Name="MinimapGui"
ScreenGui.ResetOnSpawn=false
ScreenGui.Parent=guiPlayer

local camera=Workspace.CurrentCamera
local viewportSize=camera.ViewportSize

local baseSize=math.clamp(math.floor(math.min(viewportSize.X,viewportSize.Y)*0.22),120,260)
local offsetFromEdge=math.floor(baseSize*0.15)

local MinimapFrame=Instance.new("Frame")
MinimapFrame.Name="Minimap"
MinimapFrame.Parent=ScreenGui
MinimapFrame.AnchorPoint=Vector2.new(1,0)
MinimapFrame.Position=UDim2.new(1,-offsetFromEdge,0,offsetFromEdge*0.6)
MinimapFrame.Size=UDim2.new(0,baseSize,0,baseSize)
MinimapFrame.BackgroundColor3=Color3.fromRGB(29,29,29)
MinimapFrame.BorderSizePixel=0
MinimapFrame.ClipsDescendants=true

local UIStroke=Instance.new("UIStroke")
UIStroke.Thickness=3.6
UIStroke.Color=Color3.fromRGB(70,70,70)
UIStroke.Parent=MinimapFrame

local Viewport=Instance.new("ViewportFrame")
Viewport.Parent=MinimapFrame
Viewport.Size=UDim2.new(1,0,1,0)
Viewport.BorderSizePixel=0
Viewport.BackgroundColor3=Color3.fromRGB(120,120,120)
Viewport.Ambient=Color3.new(1,1,1)
Viewport.LightColor=Color3.new(1,1,1)
Viewport.LightDirection=Vector3.new(0,-1,0)

local WorldModel=Instance.new("WorldModel")
WorldModel.Parent=Viewport

local Arrow=Instance.new("ImageLabel")
Arrow.Parent=Viewport
Arrow.AnchorPoint=Vector2.new(0.5,0.5)
Arrow.Position=UDim2.new(0.5,0,0.5,0)
Arrow.Size=UDim2.new(0,math.floor(baseSize*0.1),0,math.floor(baseSize*0.1))
Arrow.BackgroundTransparency=1
Arrow.Image="rbxassetid://5485245567"

local Camera=Instance.new("Camera")
Camera.FieldOfView=70
Camera.CameraType=Enum.CameraType.Scriptable
Camera.Parent=Viewport
Viewport.CurrentCamera=Camera

local Character=player.Character or player.CharacterAdded:Wait()
local HumanoidRootPart=Character:WaitForChild("HumanoidRootPart")

player.CharacterAdded:Connect(function(char)
Character=char
HumanoidRootPart=char:WaitForChild("HumanoidRootPart")
end)

local function holdSystem(button,name)

	local HOLD_TIME=5
	local locked=getgenv().GUI_LOCKS[name] or false
	local holding=false
	local holdStart=0
	local holdTriggered=false

	button.InputBegan:Connect(function(input)
		if input.UserInputType~=Enum.UserInputType.MouseButton1 and input.UserInputType~=Enum.UserInputType.Touch then return end
		holding=true
		holdStart=tick()
		holdTriggered=false
	end)

	button.InputEnded:Connect(function(input)
		if input.UserInputType~=Enum.UserInputType.MouseButton1 and input.UserInputType~=Enum.UserInputType.Touch then return end
		holding=false
	end)

	RunService.RenderStepped:Connect(function()
		if holding and not holdTriggered then
			if tick()-holdStart>=HOLD_TIME then
				holdTriggered=true
				locked=not locked
				getgenv().GUI_LOCKS[name]=locked
			end
		end
	end)

	return function()
		return locked
	end

end

local function drag(button,isLocked,name)

	local dragging=false
	local dragInput
	local dragStart
	local startPos

	if getgenv().GUI_POSITIONS[name] then
		button.Position=getgenv().GUI_POSITIONS[name]
	end

	button.InputBegan:Connect(function(input)
		if isLocked and isLocked() then return end
		if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then
			dragging=true
			dragInput=input
			dragStart=input.Position
			startPos=button.Position
		end
	end)

	button.InputChanged:Connect(function(input)
		if input==dragInput and dragging then
			local delta=input.Position-dragStart
			button.Position=UDim2.new(
				startPos.X.Scale,
				startPos.X.Offset+delta.X,
				startPos.Y.Scale,
				startPos.Y.Offset+delta.Y
			)
			getgenv().GUI_POSITIONS[name]=button.Position
		end
	end)

	UserInputService.InputEnded:Connect(function(input)
		if input==dragInput then
			dragging=false
			dragInput=nil
		end
	end)

end

local minimapLocked=holdSystem(MinimapFrame,"minimap")
drag(MinimapFrame,minimapLocked,"minimap")

local clonedParts={}
local allowed={Part=true,MeshPart=true,UnionOperation=true}

local function addPart(obj)

	if clonedParts[obj] then return end
	if Character and obj:IsDescendantOf(Character) then return end
	if not allowed[obj.ClassName] then return end

	if obj.Size.Magnitude<1 then return end

	local clone=obj:Clone()
	clone.Anchored=true
	clone.CanCollide=false
	clone.Parent=WorldModel

	clonedParts[obj]=clone

end

local function removePart(obj)

	local clone=clonedParts[obj]
	if clone then
		clone:Destroy()
		clonedParts[obj]=nil
	end

end

task.spawn(function()

	local count=0

	for _,obj in ipairs(Workspace:GetDescendants()) do

		addPart(obj)

		count+=1
		if count%60==0 then
			RunService.Heartbeat:Wait()
		end

	end

end)

Workspace.DescendantAdded:Connect(addPart)
Workspace.DescendantRemoving:Connect(removePart)

RunService.RenderStepped:Connect(function()

	if HumanoidRootPart then

		Camera.CFrame=CFrame.new(
			HumanoidRootPart.Position+Vector3.new(0,150,0),
			HumanoidRootPart.Position
		)

		Arrow.Rotation=-HumanoidRootPart.Orientation.Y-90

	end

end)

Features & Information

Minimap Laggy dpi around 550-800
#Minimap#Useful#Roblox#StyearX

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts