Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. local Player = game:GetService("Players").LocalPlayer
  2.  
  3. repeat
  4. wait()
  5. until Player.Character
  6.  
  7. local Torso = Player.Character:WaitForChild("Torso")
  8. local Pos = Torso.CFrame
  9.  
  10.  
  11. local Scale = 2
  12. local DefaultColor = BrickColor.new("Grey")
  13.  
  14. local Group = Instance.new("Folder")
  15. Group.Parent = workspace
  16.  
  17. local Cache = {}
  18. for y = 1, 50 do
  19. for x = 1, 50 do
  20. local Part = Instance.new("Part")
  21. Part.Anchored = true
  22. Part.Locked = true
  23. Part.CFrame = Pos *CFrame.new((x - 1)*Scale, -2, (y - 1)*Scale)
  24. Part.FormFactor = Enum.FormFactor.Custom
  25. Part.Size = Vector3.new(Scale, Scale, Scale)
  26. Part.TopSurface = Enum.SurfaceType.Smooth
  27. Part.BottomSurface = Enum.SurfaceType.Smooth
  28. Part.Parent = Group
  29. Cache[#Cache + 1] = Part
  30. end
  31. end
  32.  
  33. game:GetService("RunService").RenderStepped:connect(function()
  34. for i = 1, #Cache do
  35. local v = Cache[i]
  36. local mag = (v.Position - Torso.Position).magnitude
  37. local Pos = v.CFrame
  38. if mag < Scale*2 then
  39. v.Size = Vector3.new(Scale, Scale - 0.8, Scale)
  40. v.BrickColor = BrickColor.new("Black")
  41. else
  42. v.Size = Vector3.new(Scale, Scale, Scale)
  43. v.BrickColor = DefaultColor
  44. end
  45. v.CFrame = Pos
  46. end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement