Advertisement
anonymous321313

Untitled

Mar 29th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Creating fake input objects with fake variables
  2. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  3. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  4. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  5. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  6. end}
  7. --Merged 2 functions into one by checking amount of arguments
  8. CAS.UnbindAction = CAS.BindAction
  9.  
  10. --This function will trigger the events that have been :Connect()'ed
  11. local function te(self,ev,...)
  12. local t = m[ev]
  13. if t and t._fakeEvent and t.Function then
  14. t.Function(...)
  15. end
  16. end
  17. m.TrigEvent = te
  18. UIS.TrigEvent = te
  19.  
  20. Event.OnServerEvent:Connect(function(plr,io)
  21. if plr~=Player then return end
  22. if io.isMouse then
  23. m.Target = io.Target
  24. m.Hit = io.Hit
  25. else
  26. local b = io.UserInputState == Enum.UserInputState.Begin
  27. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  28. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  29. end
  30. for _,t in pairs(CAS.Actions) do
  31. for _,k in pairs(t.Keys) do
  32. if k==io.KeyCode then
  33. t.Function(t.Name,io.UserInputState,io)
  34. end
  35. end
  36. end
  37. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  38. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  39. end
  40. end)
  41. Event.Parent = NLS([==[
  42. local Player = game:GetService("Players").LocalPlayer
  43. local Event = script:WaitForChild("UserInput_Event")
  44.  
  45. local UIS = game:GetService("UserInputService")
  46. local input = function(io,a)
  47. if a then return end
  48. --Since InputObject is a client-side instance, we create and pass table instead
  49. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  50. end
  51. UIS.InputBegan:Connect(input)
  52. UIS.InputEnded:Connect(input)
  53.  
  54. local Mouse = Player:GetMouse()
  55. local h,t
  56. --Give the server mouse data 30 times every second, but only if the values changed
  57. --If player is not moving their mouse, client won't fire events
  58. while wait(1/30) do
  59. if h~=Mouse.Hit or t~=Mouse.Target then
  60. h,t=Mouse.Hit,Mouse.Target
  61. Event:FireServer({isMouse=true,Target=t,Hit=h})
  62. end
  63. end]==],Player.Character)
  64. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  65. end
  66.  
  67.  
  68. --Jungle Generator Gifted by TheRedAngel, Regular Script!
  69.  
  70. size = 1000
  71.  
  72.  
  73.  
  74. CA = CFrame.Angles
  75.  
  76. CN = CFrame.new
  77.  
  78. V3 = Vector3.new
  79.  
  80. MR = math.rad
  81.  
  82. MP = math.pi
  83.  
  84. MRA = math.random
  85.  
  86. MH = math.huge
  87.  
  88.  
  89.  
  90. Wood = {"Brown", "Reddish brown"}
  91.  
  92. Leaves = {"Earth green", "Bright green", "Dark green", "Camo"}
  93.  
  94. LeafMeshes = {{"http://www.roblox.com/asset/?id=16659363", V3(2.05,-1.6,2.05)},
  95.  
  96. {"http://www.roblox.com/asset/?id=1091940", V3(1.2,0.6,1.2)}}
  97.  
  98.  
  99.  
  100. Rock = {"Medium grey", "Dark grey"}
  101.  
  102.  
  103.  
  104. Add = {
  105.  
  106. Mesh = function(P, Id, Id2, scale)
  107.  
  108. local m = Instance.new("SpecialMesh", P)
  109.  
  110. m.Scale = scale
  111.  
  112. m.MeshId = Id
  113.  
  114. m.TextureId = Id2
  115.  
  116. end
  117.  
  118. }
  119.  
  120.  
  121.  
  122. function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z)
  123.  
  124. local p = Instance.new("Part")
  125.  
  126. p.TopSurface = 0
  127.  
  128. p.BottomSurface = 0
  129.  
  130. p.Transparency = Tran
  131.  
  132. p.Reflectance = Ref
  133.  
  134. p.CanCollide = Coll
  135.  
  136. p.Anchored = Anch
  137.  
  138. p.BrickColor = BrickColor.new(Col)
  139.  
  140. p.formFactor = "Custom"
  141.  
  142. p.Size = V3(X,Y,Z)
  143.  
  144. p.Parent = P
  145.  
  146. p.Locked = true
  147.  
  148. p:BreakJoints()
  149.  
  150. return p
  151.  
  152. end
  153.  
  154.  
  155.  
  156. Mod = Instance.new("Model",workspace)
  157.  
  158. Mod.Name = "Jungle"
  159.  
  160.  
  161.  
  162. Models = {
  163.  
  164. function(cf, siz)
  165.  
  166. local m = Instance.new("Model",Mod)
  167.  
  168. local cen = cf * CN(0, 0, -38*siz)
  169.  
  170. local wo = Wood[MRA(1,#Wood)]
  171.  
  172. local le = Leaves[MRA(1,#Leaves)]
  173.  
  174. local last = nil
  175.  
  176. for i = 0, 1, 0.2 do
  177.  
  178. local p = Part(m, true, true, 0, 0, wo, 3*siz, 5.7*siz, 3*siz)
  179.  
  180. Instance.new("SpecialMesh",p)
  181.  
  182. p.CFrame = cen * CA(MR(-40*i), 0, 0) * CN(0, 0, 38*siz)
  183.  
  184. if wo == Wood[1] then wo = Wood[2] else wo = Wood[1] end
  185.  
  186. last = p
  187.  
  188. end
  189.  
  190. local messa = LeafMeshes[MRA(1,#LeafMeshes)]
  191.  
  192. local a = -3
  193.  
  194. if messa == LeafMeshes[1] then
  195.  
  196. a = 0.4
  197.  
  198. end
  199.  
  200. last.BrickColor = BrickColor.new(le)
  201.  
  202. local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  203.  
  204. local m = Add.Mesh(p, messa[1], "", V3((messa[2].X*10)*siz,(messa[2].Y*10)*siz,(messa[2].Z*10)*siz))
  205.  
  206. p.CFrame = last.CFrame * CN(0, a*siz, 0) * CA(MP+MR(20), 0, 0)
  207.  
  208. end,
  209.  
  210. function(cf, siz)
  211.  
  212. local m = Instance.new("Model",Mod)
  213.  
  214. local ro1, ro2 = Rock[MRA(1,#Rock)], Rock[MRA(1,#Rock)]
  215.  
  216. local p = Part(m, true, true, 0, 0, ro1, 7.5*siz, 7.5*siz, 7.5*siz)
  217.  
  218. p.CFrame = cf * CN(0, 1.8*siz, 4*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180)))
  219.  
  220. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1290033", "", V3(5*siz, 5*siz, 5*siz))
  221.  
  222.  
  223.  
  224. local p2 = Part(m, true, true, 0, 0, ro2, 5.5*siz, 5.5*siz, 5.5*siz)
  225.  
  226. p2.CFrame = cf * CN(7*siz, 1.5*siz, -6*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180)))
  227.  
  228. local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1290033", "", V3(3.8*siz, 3.8*siz, 3.8*siz))
  229.  
  230. end,
  231.  
  232. function(cf, siz)
  233.  
  234. local m = Instance.new("Model",Mod)
  235.  
  236. local le = Leaves[MRA(1,#Leaves)]
  237.  
  238.  
  239.  
  240. local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  241.  
  242. p.CFrame = cf * CN(2*siz, 1.6*siz, -4*siz) * CA(0, 0, 0)
  243.  
  244. local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1095708", "", V3(12*siz, 11*siz, 10*siz))
  245.  
  246.  
  247.  
  248. local p2 = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2)
  249.  
  250. p2.CFrame = cf * CN(-4*siz, 1.1*siz, -1*siz) * CA(0, MR(-34), 0)
  251.  
  252. local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1095708", "", V3(10*siz, 7.5*siz, 8*siz))
  253.  
  254. end,
  255.  
  256. function(cf, siz)
  257.  
  258. local m = Instance.new("Model",Mod)
  259.  
  260.  
  261.  
  262. local p = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2)
  263.  
  264. p.CFrame = cf * CN(2*siz, 1.1*siz, -4*siz) * CA(0, 0, 0)
  265.  
  266. 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))
  267.  
  268.  
  269.  
  270. local p2 = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2)
  271.  
  272. p2.CFrame = cf * CN(-4*siz, 0.7*siz, 1*siz) * CA(MR(MRA(-15,15)), MR(MRA(-180,180)), MR(MRA(-15,15)))
  273.  
  274. 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))
  275.  
  276. end,
  277.  
  278. function(cf, siz)
  279.  
  280. local m = Instance.new("Model",Mod)
  281.  
  282.  
  283.  
  284. local p = Part(m, true, true, 0, 0, "White", 1.2*siz, 6*siz, 1.2*siz)
  285.  
  286. 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)
  287.  
  288. 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))
  289.  
  290. end,
  291.  
  292. function(cf, siz)
  293.  
  294. local m = Instance.new("Model",Mod)
  295.  
  296. local col = Wood[MRA(1,#Wood)]
  297.  
  298. local p = Part(m, true, true, 0, 0, col, 2.8*siz, 22*siz, 2.8*siz)
  299.  
  300. Instance.new("SpecialMesh",p)
  301.  
  302. 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)
  303.  
  304. local leave = Leaves[MRA(1, #Leaves)]
  305.  
  306. local mes = LeafMeshes[MRA(1, #LeafMeshes)]
  307.  
  308. local a = 3
  309.  
  310. local ca = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30)))
  311.  
  312. if mes == LeafMeshes[1] then
  313.  
  314. a = -0.5
  315.  
  316. ca = ca * CA(MP, 0, 0)
  317.  
  318. end
  319.  
  320. for i = 1, MRA(1,5) do
  321.  
  322. local cf2 = p.CFrame * CA(0, MR(MRA(-180,180)), 0) * CN(0, (MRA(2*100, 14*100)/100)*siz, -1.4*siz)
  323.  
  324. local center = cf2 * CN(0, 0, -8*siz) * CA(0, 0, 0)
  325.  
  326. local first = nil
  327.  
  328. for x = 0, 45, 15 do
  329.  
  330. local p2 = Part(m, true, true, 0, 0, col, 2.5*siz, 4*siz, 2.5*siz)
  331.  
  332. Instance.new("SpecialMesh", p2)
  333.  
  334. p2.CFrame = center * CN(0, 0, 4*siz) * CA(MR(x), 0, 0) * CN(0, 0, 10*siz) * CA(0, 0, 0)
  335.  
  336. if first == nil then first = p2 end
  337.  
  338. end
  339.  
  340. local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2)
  341.  
  342. Add.Mesh(p3, mes[1], "", (mes[2]*7)*siz)
  343.  
  344. local ca2 = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30)))
  345.  
  346. if mes == LeafMeshes[1] then
  347.  
  348. ca2 = ca2 * CA(MP, 0, 0)
  349.  
  350. end
  351.  
  352. p3.CFrame = first.CFrame * CN(0, a*siz, 0) * ca2
  353.  
  354. end
  355.  
  356. local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2)
  357.  
  358. Add.Mesh(p3, mes[1], "", (mes[2]*9)*siz)
  359.  
  360. local cn = p.CFrame * CN(0, 11*siz, 0)
  361.  
  362. p3.CFrame = cn * CN(0, a*siz, 0) * ca
  363.  
  364. end,
  365.  
  366. }
  367.  
  368.  
  369.  
  370. pos = CN(0, 0, 0)
  371.  
  372.  
  373.  
  374.  
  375.  
  376. local base = Part(Mod, true, true, 0, 0, Leaves[MRA(1,#Leaves)], size, 1, size)
  377.  
  378. base.CFrame = pos * CN(0, 1, 0)
  379.  
  380. base.Material = "Grass"
  381.  
  382.  
  383.  
  384. for x = -size/2, size/2, 20 do
  385.  
  386. for z = -size/2, size/2, 20 do
  387.  
  388. 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)
  389.  
  390. end
  391.  
  392. wait(0.2)
  393.  
  394. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement