Advertisement
HowToRoblox

MinimapHandler

Aug 3rd, 2020
4,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local screenGui = script.Parent
  2. local minimapFrame = screenGui:WaitForChild("Minimap")
  3. local directionArrow = minimapFrame:WaitForChild("DirectionArrow")
  4.  
  5.  
  6. local plr = game.Players.LocalPlayer
  7.  
  8. local char = plr.Character or plr.CharacterAdded:Wait()
  9.  
  10. local hrp = char:WaitForChild("HumanoidRootPart")
  11. local humanoid = char:WaitForChild("Humanoid")
  12.  
  13.  
  14. local currentCamera = Instance.new("Camera")
  15.  
  16. currentCamera.FieldOfView = 1
  17. currentCamera.CameraType = Enum.CameraType.Scriptable
  18.  
  19. currentCamera.Parent = workspace
  20.  
  21.  
  22. minimapFrame.CurrentCamera = currentCamera
  23.  
  24.  
  25. for i, minimapObject in pairs(workspace.MinimapObjects:GetChildren()) do
  26.  
  27.     minimapObject:Clone().Parent = minimapFrame
  28. end
  29.  
  30. game:GetService("RunService").RenderStepped:Connect(function()
  31.    
  32.     local camCFrame = CFrame.new(hrp.Position + Vector3.new(0, 5000, 0), hrp.Position)
  33.    
  34.     currentCamera.CFrame = camCFrame
  35.    
  36.    
  37.     directionArrow.Rotation = -hrp.Orientation.Y - 90
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement