aidanthescriptor101

gen.

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