Advertisement
sina4

mini map

Jan 29th, 2020
871
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. offS = Instance.new("Vector3Value")
  2. offS.Name = "Offset"
  3. offS.Value = Vector3.new(0,0,-100)
  4. offS.Parent = script
  5.  
  6. Sc = Instance.new("NumberValue")
  7. Sc.Name = "Scale"
  8. Sc.Value = 5
  9. Sc.Parent = script
  10.  
  11. script.Parent = game.Workspace
  12. local Model = Instance.new("Model",game.Lighting)
  13. Model.Name = "MinimapModel"
  14. local BoxModel = Instance.new("Model",script)
  15. BoxModel.Name = "MinimapBoxModel"
  16. local Ready = true
  17. function Track(item)
  18. local part = Instance.new("Part",Model)
  19. part.Anchored = true
  20. part.CanCollide = false
  21. part.Locked = true
  22. part.Archivable = false
  23. local box = Instance.new("SelectionBox",BoxModel)
  24. box.LineThickness = 0.015
  25. box.Adornee = part
  26. local Count = 0
  27. local Connection
  28. local function Beat()
  29. Count = Count + 1
  30. if Count > 2 then
  31. Count = 0
  32. if item and part and item:FindFirstAncestorWhichIsA("Workspace") and item:IsA("BasePart") and box then
  33. if item.CanCollide then
  34. box.Color3 = Color3.new(item.Color.r / 1.5,item.Color.g / 1.5,item.Color.b / 1.5)
  35. else
  36. box.Color3 = Color3.new(item.Color.r * 1.5,item.Color.g * 1.5,item.Color.b * 1.5)
  37. end
  38. box.SurfaceColor3 = item.Color
  39. box.SurfaceTransparency = item.Transparency
  40. part.Color = item.Color
  41. part.Material = item.Material
  42. part.Reflectance = item.Reflectance
  43. part.Transparency = item.Transparency
  44. part.Name = item:GetFullName().."Clone"
  45. part.Orientation = item.Orientation
  46. local Scale
  47. local SValue = script:FindFirstChild("Scale")
  48. if SValue and SValue:IsA("NumberValue") then
  49. Scale = SValue.Value
  50. else
  51. Scale = 5
  52. end
  53. local Offset
  54. local OValue = script:FindFirstChild("Offset")
  55. if OValue and OValue:IsA("Vector3Value") then
  56. Offset = OValue.Value
  57. else
  58. Offset = Vector3.new(0,0,-100)
  59. end
  60. part.Size = Vector3.new(item.Size.X / Scale,item.Size.Y / Scale,item.Size.Z / Scale)
  61. part.Position = Vector3.new(item.Position.X / Scale + Offset.X,item.Position.Y / Scale + Offset.Y,item.Position.Z / Scale + Offset.Z)
  62. elseif item and part and item:FindFirstAncestorWhichIsA("Workspace") and item:IsA("Explosion") and box then
  63. if item.DestroyJointRadiusPercent == 0 then
  64. box.Color3 = Color3.new(0.75,0.75,0.75)
  65. box.SurfaceColor3 = Color3.new(0.5,0.5,0.5)
  66. elseif item.BlastPressure >= 500000 and item.BlastPressure < 1500000 then
  67. box.Color3 = Color3.new(0.8,0.55,0)
  68. box.SurfaceColor3 = Color3.new(1,1,0)
  69. elseif item.BlastPressure >= 1500000 and item.BlastPressure <= 5000000 then
  70. box.Color3 = Color3.new(0.9,0.4,0)
  71. box.SurfaceColor3 = Color3.new(1,0.4,0)
  72. elseif item.BlastPressure >= 5000000 then
  73. box.Color3 = Color3.new(1,0,0)
  74. box.SurfaceColor3 = Color3.new(0.8,0,0)
  75. else
  76. box.Color3 = Color3.new(0.9,0.9,0.45)
  77. box.SurfaceColor3 = Color3.new(1,1,0.5)
  78. end
  79. box.SurfaceTransparency = 0.5
  80. part.Name = item:GetFullName().."Clone"
  81. local Scale
  82. local SValue = script:FindFirstChild("Scale")
  83. if SValue and SValue:IsA("NumberValue") then
  84. Scale = SValue.Value
  85. else
  86. Scale = 5
  87. end
  88. local Offset
  89. local OValue = script:FindFirstChild("Offset")
  90. if OValue and OValue:IsA("Vector3Value") then
  91. Offset = OValue.Value
  92. else
  93. Offset = Vector3.new(0,0,-100)
  94. end
  95. part.Size = Vector3.new(item.BlastRadius / Scale,item.BlastRadius / Scale,item.BlastRadius / Scale)
  96. part.Position = Vector3.new(item.Position.X / Scale + Offset.X,item.Position.Y / Scale + Offset.Y,item.Position.Z / Scale + Offset.Z)
  97. else
  98. if part then
  99. part:Destroy()
  100. end
  101. if box then
  102. box:Destroy()
  103. end
  104. Connection:Disconnect()
  105. end
  106. end
  107. end
  108. Connection = game:GetService("RunService").Heartbeat:connect(Beat)
  109. end
  110.  
  111. function Added(obj)
  112. if (obj:IsA("BasePart") or obj:IsA("Explosion")) and not obj:IsA("Terrain") then
  113. repeat wait(0.03) until Ready == true
  114. if obj then
  115. Track(obj)
  116. Ready = false
  117. wait(0.03)
  118. Ready = true
  119. end
  120. end
  121. end
  122. game.Workspace.DescendantAdded:connect(Added)
  123.  
  124. local D = game.Workspace:GetDescendants()
  125. for i = 1,#D do
  126. if (D[i]:IsA("BasePart") or D[i]:IsA("Explosion")) and not D[i]:IsA("Terrain") then
  127. repeat wait(0.03) until Ready == true
  128. if D[i] then
  129. Track(D[i])
  130. Ready = false
  131. wait(0.03)
  132. Ready = true
  133. end
  134. end
  135. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement