Upscalefanatic34

Jungle

May 22nd, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. size = 240
  2.  
  3.  
  4.  
  5. CA = CFrame.Angles
  6.  
  7. CN = CFrame.new
  8.  
  9. V3 = Vector3.new
  10.  
  11. MR = math.rad
  12.  
  13. MP = math.pi
  14.  
  15. MRA = math.random
  16.  
  17. MH = math.huge
  18.  
  19.  
  20.  
  21. Wood = {"Brown", "Reddish brown"}
  22.  
  23. Leaves = {"Earth green", "Bright green", "Dark green", "Camo"}
  24.  
  25. LeafMeshes = {{"http://www.roblox.com/asset/?id=16659363", V3(2.05,-1.6,2.05)},
  26.  
  27. {"http://www.roblox.com/asset/?id=1091940", V3(1.2,0.6,1.2)}}
  28.  
  29.  
  30.  
  31. Rock = {"Medium grey", "Dark grey"}
  32.  
  33.  
  34.  
  35. Add = {
  36.  
  37. Mesh = function(P, Id, Id2, scale)
  38.  
  39. local m = Instance.new("SpecialMesh", P)
  40.  
  41. m.Scale = scale
  42.  
  43. m.MeshId = Id
  44.  
  45. m.TextureId = Id2
  46.  
  47. end
  48.  
  49. }
  50.  
  51.  
  52.  
  53. function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z)
  54.  
  55. local p = Instance.new("Part")
  56.  
  57. p.TopSurface = 0
  58.  
  59. p.BottomSurface = 0
  60.  
  61. p.Transparency = Tran
  62.  
  63. p.Reflectance = Ref
  64.  
  65. p.CanCollide = Coll
  66.  
  67. p.Anchored = Anch
  68.  
  69. p.BrickColor = BrickColor.new(Col)
  70.  
  71. p.formFactor = "Custom"
  72.  
  73. p.Size = V3(X,Y,Z)
  74.  
  75. p.Parent = P
  76.  
  77. p.Locked = true
  78.  
  79. p:BreakJoints()
  80.  
  81. return p
  82.  
  83. end
  84.  
  85.  
  86.  
  87. Mod = Instance.new("Model",workspace)
  88.  
  89. Mod.Name = "Jungle"
  90.  
  91.  
  92.  
  93. Models = {
  94.  
  95. function(cf, siz)
  96.  
  97. local m = Instance.new("Model",Mod)
  98.  
  99. local cen = cf * CN(0, 0, -38*siz)
  100.  
  101. local wo = Wood[MRA(1,#Wood)]
  102.  
  103. local le = Leaves[MRA(1,#Leaves)]
  104.  
  105. local last = nil
  106.  
  107. for i = 0, 1, 0.2 do
  108.  
  109. local p = Part(m, true, true, 0, 0, wo, 3*siz, 5.7*siz, 3*siz)
  110.  
  111. Instance.new("SpecialMesh",p)
  112.  
  113. p.CFrame = cen * CA(MR(-40*i), 0, 0) * CN(0, 0, 38*siz)
  114.  
  115. if wo == Wood[1] then wo = Wood[2] else wo = Wood[1] end
  116.  
  117. last = p
  118.  
  119. end
  120.  
  121. local messa = LeafMeshes[MRA(1,#LeafMeshes)]
  122.  
  123. local a = -3
  124.  
  125. if messa == LeafMeshes[1] then
  126.  
  127. a = 0.4
  128.  
  129. end
  130.  
  131. last.BrickColor = BrickColor.new(le)
  132.  
  133. local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  134.  
  135. local m = Add.Mesh(p, messa[1], "", V3((messa[2].X*10)*siz,(messa[2].Y*10)*siz,(messa[2].Z*10)*siz))
  136.  
  137. p.CFrame = last.CFrame * CN(0, a*siz, 0) * CA(MP+MR(20), 0, 0)
  138.  
  139. end,
  140.  
  141. function(cf, siz)
  142.  
  143. local m = Instance.new("Model",Mod)
  144.  
  145. local ro1, ro2 = Rock[MRA(1,#Rock)], Rock[MRA(1,#Rock)]
  146.  
  147. local p = Part(m, true, true, 0, 0, ro1, 7.5*siz, 7.5*siz, 7.5*siz)
  148.  
  149. p.CFrame = cf * CN(0, 1.8*siz, 4*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180)))
  150.  
  151. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1290033", "", V3(5*siz, 5*siz, 5*siz))
  152.  
  153.  
  154.  
  155. local p2 = Part(m, true, true, 0, 0, ro2, 5.5*siz, 5.5*siz, 5.5*siz)
  156.  
  157. p2.CFrame = cf * CN(7*siz, 1.5*siz, -6*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180)))
  158.  
  159. local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1290033", "", V3(3.8*siz, 3.8*siz, 3.8*siz))
  160.  
  161. end,
  162.  
  163. function(cf, siz)
  164.  
  165. local m = Instance.new("Model",Mod)
  166.  
  167. local le = Leaves[MRA(1,#Leaves)]
  168.  
  169.  
  170.  
  171. local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  172.  
  173. p.CFrame = cf * CN(2*siz, 1.6*siz, -4*siz) * CA(0, 0, 0)
  174.  
  175. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1095708", "", V3(12*siz, 11*siz, 10*siz))
  176.  
  177.  
  178.  
  179. local p2 = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  180.  
  181. p2.CFrame = cf * CN(-4*siz, 1.1*siz, -1*siz) * CA(0, MR(-34), 0)
  182.  
  183. local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1095708", "", V3(10*siz, 7.5*siz, 8*siz))
  184.  
  185. end,
  186.  
  187. function(cf, siz)
  188.  
  189. local m = Instance.new("Model",Mod)
  190.  
  191.  
  192.  
  193. local p = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2)
  194.  
  195. p.CFrame = cf * CN(2*siz, 1.1*siz, -4*siz) * CA(0, 0, 0)
  196.  
  197. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=16659363", "http://www.roblox.com/asset/?id=16659355", V3(10*siz, 14*siz, 10*siz))
  198.  
  199.  
  200.  
  201. local p2 = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2)
  202.  
  203. p2.CFrame = cf * CN(-4*siz, 0.7*siz, 1*siz) * CA(MR(MRA(-15,15)), MR(MRA(-180,180)), MR(MRA(-15,15)))
  204.  
  205. local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=16659363", "http://www.roblox.com/asset/?id=16659355", V3(7*siz, 11*siz, 6*siz))
  206.  
  207. end,
  208.  
  209. function(cf, siz)
  210.  
  211. local m = Instance.new("Model",Mod)
  212.  
  213.  
  214.  
  215. local p = Part(m, true, true, 0, 0, "White", 1.2*siz, 6*siz, 1.2*siz)
  216.  
  217. p.CFrame = cf * CN((MRA(-4*100,4*100)/100)*siz, 3.2*siz, (MRA(-4*100,4*100)/100)*siz) * CA(0, MR(MRA(-180,180)), 0)
  218.  
  219. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1090398", "http://www.roblox.com/asset/?id=1090399", V3(3.5*siz, 5*siz, 3.5*siz))
  220.  
  221. end,
  222.  
  223. function(cf, siz)
  224.  
  225. local m = Instance.new("Model",Mod)
  226.  
  227. local col = Wood[MRA(1,#Wood)]
  228.  
  229. local p = Part(m, true, true, 0, 0, col, 2.8*siz, 22*siz, 2.8*siz)
  230.  
  231. Instance.new("SpecialMesh",p)
  232.  
  233. p.CFrame = cf * CN((MRA(-4*100,4*100)/100)*siz, 11*siz, (MRA(-4*100,4*100)/100)*siz) * CA(0, MR(MRA(-180,180)), 0)
  234.  
  235. local leave = Leaves[MRA(1, #Leaves)]
  236.  
  237. local mes = LeafMeshes[MRA(1, #LeafMeshes)]
  238.  
  239. local a = 3
  240.  
  241. local ca = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30)))
  242.  
  243. if mes == LeafMeshes[1] then
  244.  
  245. a = -0.5
  246.  
  247. ca = ca * CA(MP, 0, 0)
  248.  
  249. end
  250.  
  251. for i = 1, MRA(1,5) do
  252.  
  253. local cf2 = p.CFrame * CA(0, MR(MRA(-180,180)), 0) * CN(0, (MRA(2*100, 14*100)/100)*siz, -1.4*siz)
  254.  
  255. local center = cf2 * CN(0, 0, -8*siz) * CA(0, 0, 0)
  256.  
  257. local first = nil
  258.  
  259. for x = 0, 45, 15 do
  260.  
  261. local p2 = Part(m, true, true, 0, 0, col, 2.5*siz, 4*siz, 2.5*siz)
  262.  
  263. Instance.new("SpecialMesh", p2)
  264.  
  265. p2.CFrame = center * CN(0, 0, 4*siz) * CA(MR(x), 0, 0) * CN(0, 0, 10*siz) * CA(0, 0, 0)
  266.  
  267. if first == nil then first = p2 end
  268.  
  269. end
  270.  
  271. local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2)
  272.  
  273. Add.Mesh(p3, mes[1], "", (mes[2]*7)*siz)
  274.  
  275. local ca2 = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30)))
  276.  
  277. if mes == LeafMeshes[1] then
  278.  
  279. ca2 = ca2 * CA(MP, 0, 0)
  280.  
  281. end
  282.  
  283. p3.CFrame = first.CFrame * CN(0, a*siz, 0) * ca2
  284.  
  285. end
  286.  
  287. local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2)
  288.  
  289. Add.Mesh(p3, mes[1], "", (mes[2]*9)*siz)
  290.  
  291. local cn = p.CFrame * CN(0, 11*siz, 0)
  292.  
  293. p3.CFrame = cn * CN(0, a*siz, 0) * ca
  294.  
  295. end,
  296.  
  297. }
  298.  
  299.  
  300.  
  301. pos = CN(0, 0, 0)
  302.  
  303.  
  304.  
  305.  
  306.  
  307. local base = Part(Mod, true, true, 0, 0, Leaves[MRA(1,#Leaves)], size, 1, size)
  308.  
  309. base.CFrame = pos * CN(0, 1, 0)
  310.  
  311. base.Material = "Grass"
  312.  
  313.  
  314.  
  315. for x = -size/2, size/2, 20 do
  316.  
  317. for z = -size/2, size/2, 20 do
  318.  
  319. Models[MRA(1, #Models)](pos * CN(x+(MRA(-4*1000, 4*1000)/1000), 1.2, z+(MRA(-4*1000, 4*1000)/1000)) * CA(0, MR(MRA(-180,180)), 0), MRA(1.1*100, 2.4*100)/100)
  320.  
  321. end
  322.  
  323. wait(0.2)
  324.  
  325. end
Add Comment
Please, Sign In to add comment