DuckyHacks4Sale

Mini Map

Jan 3rd, 2017
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. pos = Vector3.new(0,2,0)
  2. small = 5
  3.  
  4. local model = Instance.new("Model",workspace)
  5. model.Name = "Lol MAP"
  6.  
  7. objs = {}
  8.  
  9. function showpart(part,ta)
  10. if part:IsA("BasePart") then
  11. local p = Instance.new("Part")
  12. p.formFactor = "Symmetric"
  13. p.Size = Vector3.new(1,1,1)
  14. p.BrickColor = part.BrickColor
  15. p.TopSurface = part.TopSurface
  16. p.BottomSurface = part.BottomSurface
  17. p.RightSurface = part.RightSurface
  18. p.LeftSurface = part.LeftSurface
  19. p.FrontSurface = part.FrontSurface
  20. p.BackSurface = part.BackSurface
  21. p.Material = part.Material
  22. p.Reflectance = part.Reflectance
  23. p.Transparency = part.Transparency
  24. p.Anchored = true
  25. p.CanCollide = false
  26. local m = Instance.new("BlockMesh",p)
  27. m.Scale = Vector3.new(part.Size.X/small, part.Size.Y/small, part.Size.Z/small)
  28. part.Changed:connect(function()
  29. p.BrickColor = part.BrickColor
  30. p.Transparency = part.Transparency
  31. m.Scale = Vector3.new(part.Size.X/small, part.Size.Y/small, part.Size.Z/small)
  32. p.Reflectance = part.Reflectance
  33. end)
  34. p.Parent = model
  35. table.insert(ta,p)
  36. end
  37. end
  38.  
  39. function parts(p)
  40. p.ChildAdded:connect(function(obj)
  41. if obj:IsA("BasePart") then
  42. local t = {obj}
  43. showpart(obj,t)
  44. table.insert(objs,t)
  45. end
  46. end)
  47. p.ChildRemoved:connect(function(obj)
  48. for i,v in pairs(objs) do
  49. if obj == v[1] then
  50. v[2]:remove()
  51. table.remove(objs,i)
  52. end
  53. end
  54. end)
  55. for _,v in pairs(p:children()) do
  56. if v:IsA("BasePart") and p.Name ~= "Lol MAP" then
  57. local t = {v}
  58. showpart(v,t)
  59. table.insert(objs,t)
  60. end
  61. parts(v)
  62. end
  63. end
  64.  
  65. parts(workspace)
  66.  
  67. while true do
  68. wait()
  69. for _,v in pairs(objs) do
  70. local a,b,c = v[1].CFrame.x, v[1].CFrame.y, v[1].CFrame.z
  71. local d,e,f = v[1].CFrame:toEulerAnglesXYZ()
  72. v[2].CFrame = CFrame.new(pos) * CFrame.new(a/small,b/small,c/small) * CFrame.Angles(d,e,f)
  73. end
  74. end
Add Comment
Please, Sign In to add comment