Advertisement
dahpiglz

terrain2

Sep 6th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. landsize = 5
  2. terrainsize = 100
  3. spawnmade = 0
  4. treeontile = 0
  5. se = Instance.new("Part")
  6. se.Parent = game.Workspace
  7. se.Position = Vector3.new(-256, -5, -256)
  8. se.Size = Vector3.new(25, 5, 25)
  9. se.CanCollide = false
  10. se.Anchored = true
  11.  
  12. for I=1,terrainsize do
  13. for l=1,terrainsize do
  14. se.Position = se.Position + Vector3.new(0,0,landsize)
  15. p = se:Clone()
  16. p.BrickColor = BrickColor.new("Bright green")
  17. p.Material = ("Grass")
  18. p.Name = ("GroundTileDirt")
  19. p.CanCollide = false
  20. p.Parent = game.Workspace
  21. p.Anchored = true
  22. r = math.random(-1,1)
  23. p.Position = p.Position + Vector3.new(0, r, 0)
  24. p.Size = Vector3.new(landsize, 5 ,landsize)
  25. p.CanCollide = true
  26. treeontile = (0)
  27. r2 = math.random(1,25)
  28. if r2 == (1) then
  29. if spawnmade == (0) then
  30. local spawn = Instance.new("SpawnLocation")
  31. spawn.Anchored = true
  32. spawn.TopSurface = ("Smooth")
  33. spawn.Position = p.Position + Vector3.new(0,1,0)
  34. spawn.Size = Vector3.new(4,1,4)
  35. spawndecal = Instance.new("Decal")
  36. spawndecal.Texture = ("rbxasset://textures/SpawnLocation.png")
  37. spawndecal.Face = ("Top")
  38. spawndecal.Parent = spawn
  39. spawn.Parent = game.Workspace.Camera
  40. spawnmade = (1)
  41. end
  42. end
  43. r3 = math.random(1,250)
  44. if r3 == (1) then
  45. treeontile = (1)
  46. tree = Instance.new("Model")
  47. tree.Name = ("Tree")
  48. health = Instance.new("IntValue")
  49. health.Parent = tree
  50. health.Value = 0
  51. health.Name = ("Duration")
  52. tree1 = Instance.new("Part")
  53. tree.Parent = game.Workspace
  54. tree2 = Instance.new("Part")
  55. tree1.Name = ("Log")
  56. tree2.Name = ("Leaves")
  57. tree1.Anchored = true
  58. tree2.Anchored = true
  59. tree1.Parent = tree
  60. tree2.Parent = tree
  61. tree1.CanCollide = false
  62. treeheight = math.random(12,18)
  63. tree1.Size = Vector3.new(2,treeheight,2)
  64. tree2.Size = Vector3.new(8,8,8)
  65. tree1.Position = p.Position + Vector3.new(0, -2, 0)
  66. tree2.Position = tree1.Position
  67. tree2.CanCollide = false
  68. tree2.Position = tree2.Position + Vector3.new(0, -2, 0)
  69. tree1.Position = tree1.Position + Vector3.new(0, 0, 0)
  70. tree2.Position = tree2.Position + Vector3.new(0, -2, 0)
  71. tree2.Shape = ("Ball")
  72. tree1.BrickColor = BrickColor.new("Dirt brown")
  73. tree2.BrickColor = BrickColor.new("Bright green")
  74. tree1.TopSurface = ("Smooth")
  75. tree1.BottomSurface = ("Smooth")
  76. tree2.TopSurface = ("Smooth")
  77. tree2.BottomSurface = ("Smooth")
  78. end
  79. local r4 = math.random(1,5000)
  80. if r4 == (1) then
  81. --structure = game.Lighting.CampFire:Clone()
  82. --structure:TranslateBy(Vector3.new(p.Position.X, -5, p.Position.Z))
  83. --structure.Parent = game.Workspace
  84. end
  85. local r5 = math.random(1,50)
  86. if r5 == (1) then
  87. if treeontile == (0) then
  88. rock = Instance.new("Part")
  89. rock.Parent = game.Workspace
  90. rock.Name = ("Rock")
  91. rock.CanCollide = false
  92. rock.Position = p.Position + Vector3.new(0,3,0)
  93. rock.TopSurface = ("Smooth")
  94. rock.BottomSurface = ("Smooth")
  95. rock.Size = Vector3.new(4,2,4)
  96. rock.Anchored = true
  97. rock.CanCollide = true
  98. rock.Material = ("Slate")
  99. end
  100. end
  101. end
  102. terrainsize2 = terrainsize * landsize
  103. se.Position = se.Position + Vector3.new(landsize,0,-terrainsize2)
  104. wait(0.01)
  105. end
  106.  
  107. local player = game.Players.LocalPlayer
  108. player.Chatted:connect(function(message)
  109. if message == ("cleart") then
  110. game.Workspace.Camera:ClearAllChildren()
  111. end
  112. end)
  113.  
  114. while true do
  115. game.Workspace.Base.CanCollide = false
  116. game.Workspace.Base.Transparency = 1
  117. wait(0.1)
  118. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement