Advertisement
dpeanut1

city generate

Dec 25th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. local top = 500 * 2
  2. local width = 100
  3.  
  4. for i = 0, top, 2 do
  5. if i ~= top and i ~= top - 2 then
  6. local p = Instance.new("Part", Workspace)
  7. p.FormFactor = "Custom"
  8. p.Size = Vector3.new(width, 2, 2)
  9. p.Anchored = true
  10. p.CFrame = CFrame.new(0, i, i)
  11. --p.BrickColor = BrickColor.new(Color3.new(math.random(1, 255) / 255, math.random(1, 255) / 255, math.random(1, 255) / 255))
  12. p.BrickColor = BrickColor.new(Color3.new(i / top, 0, 0))
  13. p.BrickColor = BrickColor.new("Really black")
  14. p.TopSurface = 0
  15. p.BottomSurface = 0
  16. if math.random(1, 25) == 1 then
  17. coroutine.resume(coroutine.create(function()
  18. while p.Parent ~= nil do
  19. p.BrickColor = BrickColor.new("Really red")
  20. wait(0.05)
  21. p.BrickColor = BrickColor.new("Really black")
  22. wait(0.05)
  23. end
  24. end))
  25. p.Touched:connect(function(hit) hit:BreakJoints() end)
  26. end
  27. else
  28. local p = Instance.new("SpawnLocation", Workspace)
  29. p.Size = Vector3.new(width / 2, 4, 4)
  30. p.Anchored = true
  31. p.CFrame = CFrame.new(width / 4, i, i)
  32. p.BrickColor = BrickColor.new("Bright green")
  33. p.TopSurface = 0
  34. p.BottomSurface = 0
  35. p.Touched:connect(function(hit) pcall(function() hit.Parent.Torso.Velocity = Vector3.new(0, 0, -25) hit.Parent.Humanoid.PlatformStand = true end) end)
  36. local m = Instance.new("SpecialMesh", p)
  37. m.MeshType = "Brick"
  38. m.Scale = Vector3.new((width / 2) / p.Size.x, 1, 1)
  39. local p = Instance.new("SpawnLocation", Workspace)
  40. p.Size = Vector3.new(width / 2, 4, 4)
  41. p.Anchored = true
  42. p.CFrame = CFrame.new(-width / 4, i, i)
  43. p.BrickColor = BrickColor.new("Bright green")
  44. p.TopSurface = 0
  45. p.BottomSurface = 0
  46. p.Touched:connect(function(hit) pcall(function() hit.Parent.Torso.Velocity = Vector3.new(0, 0, -25) hit.Parent.Humanoid.PlatformStand = true end) end)
  47. local m = Instance.new("SpecialMesh", p)
  48. m.MeshType = "Brick"
  49. m.Scale = Vector3.new((width / 2) / p.Size.x, 1, 1)
  50. break
  51. end
  52. wait()
  53. end
  54.  
  55. local p = Instance.new("Part", Workspace)
  56. p.FormFactor = "Custom"
  57. p.Size = Vector3.new(2, top * 2, top + 2)
  58. p.Anchored = true
  59. p.Transparency = 0.5
  60. p.CFrame = CFrame.new(width / 2, top, top / 2)
  61. p.BrickColor = BrickColor.new("Institutional white")
  62.  
  63. local p = Instance.new("Part", Workspace)
  64. p.FormFactor = "Custom"
  65. p.Size = Vector3.new(2, top * 2, top + 2)
  66. p.Anchored = true
  67. p.Transparency = 0.5
  68. p.CFrame = CFrame.new(-width / 2, top, top / 2)
  69. p.BrickColor = BrickColor.new("Institutional white")
  70.  
  71. local p = Instance.new("Part", Workspace)
  72. p.FormFactor = "Custom"
  73. p.Size = Vector3.new(width + 2, top * 2, 2)
  74. p.Anchored = true
  75. p.Transparency = 0.5
  76. p.CFrame = CFrame.new(0, top, top + 2)
  77. p.BrickColor = BrickColor.new("Institutional white")
  78.  
  79. Workspace:BreakJoints()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement