Advertisement
mathmasterphil

Hat Part 2

Mar 6th, 2015
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. me = game.Players.LocalPlayer
  2. name = “PointLight
  3. pcall(function() workspace[name]:remove() end)
  4. local m = Instance.new("Model",workspace)
  5. m.Name = name
  6. cs = {"Institutional white", "White", "Light blue", "Tr. Blue", "Medium blue", "Bright blue", "Navy blue", "Really black"}
  7. function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
  8. part.Parent = parent
  9. part.formFactor = form
  10. part.CanCollide = collide
  11. part.Transparency = tran
  12. part.Reflectance = ref
  13. part.Size = Vector3.new(x,y,z)
  14. part.BrickColor = BrickColor.new(color)
  15. part.TopSurface = 0
  16. part.BottomSurface = 0
  17. part.Anchored = anchor
  18. part.Locked = true
  19. part:BreakJoints()
  20. end
  21. parts = {}
  22. ball = nil
  23. x = 0
  24. z = 0
  25. max = 80
  26. cent = max/2
  27. repeat
  28.     local p = Instance.new("Part")
  29.     prop(p,m,true,0,0,8,1,8,cs[#cs],true,"Custom")
  30.     p.CFrame = CFrame.new(x,1.5,z)
  31.     Instance.new("BlockMesh",p)
  32.     table.insert(parts,p)
  33.     x = x + p.Size.X
  34.     if x > max then
  35.         x = 0
  36.         z = z + p.Size.Z
  37.     end
  38. until z > max
  39. for i=1,360,10 do
  40.     for g = 3.5, (8 * 3) + 3.5, 8 do
  41.         local p = Instance.new("Part")
  42.         prop(p,m,true,0,0,8,8,2,cs[#cs],true,"Custom")
  43.         p.CFrame = CFrame.new(cent,1.5,cent) * CFrame.Angles(0,math.rad(i),0) * CFrame.new(o,g,-cent)
  44.         Instance.new("BlockMesh",p)
  45.         table.insert(parts,p)
  46.     end
  47. end
  48. local b = Instance.new("Part")
  49. prop(b,m,true,0,0.2,3,3,3,"Institutional white",false,"Custom")
  50. b.Shape = "Ball"
  51. b.Position = Vector3.new(max/2,40,max/2)
  52. wait(2)
  53. coroutine.resume(coroutine.create(function()
  54. while true do
  55.     wait()
  56.     for _,v in pairs(parts) do
  57.         pcall(function()
  58.         local dist = math.floor((v.Position - b.Position).magnitude/3)
  59.         if dist > #cs then
  60.             dist = #cs
  61.         end
  62.         local c = BrickColor.new(cs[dist])
  63.         v.BrickColor = c
  64.         end)
  65.     end
  66. end
  67. end))
  68. if script.Parent.className ~= "HopperBin" then
  69.     h = Instance.new("HopperBin",me.Backpack)
  70.     h.Name = "Bounce"
  71.     script.Parent = h
  72. end
  73. bin = script.Parent
  74. for _,v in pairs(me.Backpack:children()) do
  75.     if v ~= bin then
  76.         v:remove()
  77.     end
  78. end
  79. bin.Selected:connect(function(m)
  80.     m.Button1Down:connect(function()
  81.         b:BreakJoints()
  82.         local cf = CFrame.new(b.Position, m.Hit.p)
  83.         b.Velocity = cf.lookVector * 30 + Vector3.new(0,30,0)
  84.     end)
  85. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement