Advertisement
Upscalefanatic3

Nature

Oct 4th, 2016
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.27 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2. local character = plr.Character
  3. local plrgui = plr:findFirstChild'PlayerGui'
  4. local mouse = plr:GetMouse()
  5. local camera = workspace.CurrentCamera
  6. --
  7.  
  8. game:service'Lighting'.Outlines = false --bad outlines
  9.  
  10. --
  11. local eraser = false
  12. local combo = false
  13. local stackable = false
  14. --
  15. local model = Instance.new("Model", character)
  16. model.Name = "Build"
  17. model.ChildAdded:connect(function(object)
  18. if model.Parent ~= workspace then
  19. model.Parent = workspace
  20. end
  21. if object:IsA'Part' then
  22. object.Anchored = true
  23. object.Locked = true
  24. object.TopSurface = 0
  25. object.BottomSurface = 0
  26. if stackable then
  27. wait()
  28. local x,y,z = object.CFrame:toEulerAnglesXYZ()
  29. local ray = Ray.new(camera.CoordinateFrame.p, (mouse.Hit.p - camera.CoordinateFrame.p))
  30. local hit, pos = workspace:findPartOnRay(ray, lolno_dis_stands_for_nutin)
  31. if hit and pos then
  32. object.CFrame = CFrame.new(pos.x, pos.y, pos.z) * CFrame.Angles(x,y,z)
  33. end
  34. end
  35. end
  36. end)
  37. -- GenerateTree(location, complexity, width, height)
  38. do
  39. --[[
  40.  
  41. _G.GenerateTree (location, complexity, width, height)
  42.  
  43. Procedurally generates neat-looking trees of various sizes and shapes.
  44.  
  45. Arguments:
  46.  
  47. location: position tree will "sprout" out of
  48. complexity: # of times to branch out
  49. determines overall size and quality of tree
  50. produces between m^c+(m^(c+1)-1)/(m-1) parts,
  51. where c is complexity,
  52. and m is either the min or max # of possible branches
  53. (currently, both min and max are 2)
  54. width: initial x/z size of tree base
  55. determines overall thickness of tree
  56. height: initial y size of tree base
  57. contributes to sparseness of tree
  58.  
  59. ]]
  60.  
  61. -- TODO: prevent overcrowding of branches
  62.  
  63. local Base = Instance.new("Part")
  64. Base.Name = "Trunk"
  65. Base.formFactor = "Custom"
  66. Base.TopSurface = 0
  67. Base.BottomSurface = 0
  68. Base.Anchored = true
  69. Base.Locked = true
  70. Base.BrickColor = BrickColor.new(217)
  71. local Leaves = Base:Clone()
  72. Leaves.Name = "Leaves"
  73. Leaves.CanCollide = false
  74. Leaves.Material = "Grass"
  75. Leaves.BrickColor = BrickColor.new(37)
  76. Instance.new("CylinderMesh",Base)
  77.  
  78.  
  79. -- get dot product of yz angles
  80. function dot(c1,c2)
  81. local m = CFrame.Angles(math.pi/2,0,0)
  82. return (c1*m).lookVector:Dot((c2*m).lookVector)
  83. end
  84.  
  85. -- multiplier for various sizes of foliage
  86. local leaf_mult = {
  87. Vector3.new(1.5,1.5,1.2);
  88. Vector3.new(1.5,1,1.5);
  89. Vector3.new(1.2,1.5,1.5);
  90. Vector3.new(1.5,1.5,1.5);
  91. }
  92.  
  93. function Branch(base,c)
  94. if c <= 0 then
  95. -- if the complexity has run out, generate some foliage
  96. local leaves = Leaves:Clone()
  97. local vol = base.Size.x+base.Size.y+base.Size.z -- determine size based on branch size
  98. leaves.Size = leaf_mult[math.random(1,#leaf_mult)]*math.random(vol/3*10,vol/3*12)/10
  99. leaves.CFrame = base.CFrame * CFrame.new(0,base.Size.y/2,0) -- center foliage at top of branch
  100. leaves.Parent = base.Parent
  101. else
  102. -- otherwise, make some more branches
  103. local pos = base.CFrame*CFrame.new(0,base.Size/2,0)
  104. local height = base.Size.y
  105. local width = base.Size.x
  106. local nb = math.random(2,2) -- # of possible branches (2 seems to work fine for now)
  107. local r = math.random(45,135) -- rotation of branches on y axis
  108.  
  109. -- branch split angle difference
  110. -- the less complexity, the greater the possible angle
  111. -- minimum: 20-75; maximum: 40-80
  112. local da = math.random(20+55/c,40+40/c)
  113.  
  114. -- branch angle (overall angle of all branches)
  115. local ba = math.random(-da/3,da/3)
  116.  
  117. -- ba+da/2 shouldn't be near or greater than 90 degrees
  118.  
  119. for i=0,nb-1 do -- for each branch
  120. local branch = base:Clone()
  121. branch.Name = "Branch"
  122. local h = height*math.random(95,115)/100 -- height .95 to 1.15 of original
  123.  
  124. -- make new cframe
  125. -- move new to top of base, then apply branch angle (ba)
  126. local new = branch.CFrame * CFrame.new(0,height/2,0) * CFrame.Angles(0,0,math.rad(ba))
  127. -- next, rotate branch so that it faces away from others, also apply overall rotation (r)
  128. -- also, apply the split angle (da)
  129. -- finally, move branch upward by half it's size
  130. new = new * CFrame.Angles(0,i*(math.pi*2/nb)+r,math.rad(da/2)) * CFrame.new(0,h/2,0)
  131.  
  132. -- determine width by branch's final angle; greater the angle, smaller the width
  133. -- also shave off a bit of width for more dramatic change in size
  134. -- a frustum cone mesh would really help here
  135. local w = dot(new,branch.CFrame)*width*0.9
  136.  
  137. branch.Size = Vector3.new(w,h,w)
  138. branch.CFrame = new
  139. branch.Parent = base.Parent
  140.  
  141. -- create the next set of branches with one less complexity
  142. Branch(branch,c-1)
  143. end
  144. end
  145. end
  146.  
  147.  
  148. -- Main Function ----------------
  149. function GenerateTree(location,complexity,width,height)
  150. local tree = Instance.new("Model")
  151. tree.Name = "Tree"
  152. tree.Parent = model
  153. local base = Base:Clone()
  154. base.Parent = tree
  155. base.Size = Vector3.new(width,height,width)
  156. base.CFrame = location * CFrame.new(0,height/2,0) * CFrame.Angles(0,math.rad(math.random(1,360)),0)
  157. Branch(base,complexity)
  158. return tree
  159. end
  160.  
  161. end
  162. --
  163. currently = 'Nothing - X'
  164. Props = {
  165.  
  166. ['Puddle - Q'] = function(plr)
  167. local puddle = Instance.new("Part", model)
  168. puddle.FormFactor = 'Custom'
  169. puddle.Size = Vector3.new(2, .4, 2)
  170. puddle.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.05, mouse.Hit.z)
  171. puddle.CanCollide = false
  172. puddle.BrickColor = BrickColor.new(102)
  173. puddle.Transparency = .2
  174. local mesh = Instance.new("CylinderMesh", puddle)
  175. mesh.Scale = Vector3.new(2, 1.05, 2)
  176. local sized = false
  177. mouse.Move:connect(function()
  178. if sized then return end
  179. size = (puddle.Position - mouse.Hit.p).magnitude
  180. if size >= 30 then size = 30 end
  181. if size <= 2 then size = 2 end
  182. mesh.Scale = Vector3.new(size, 1.05, size)
  183. end)
  184. mouse.Button1Up:connect(function()
  185. if sized then return end
  186. sized = true
  187. size = (puddle.Position - mouse.Hit.p).magnitude
  188. if size >= 30 then size = 30 end
  189. if size <= 2 then size = 2 end
  190. mesh.Scale = Vector3.new(size, 1.05, size)
  191. end)
  192. end;
  193. ['Cattail - C'] = function(plr)
  194. local stick = Instance.new("Part", model)
  195. stick.FormFactor = 'Custom'
  196. stick.Size = Vector3.new(.2, 3.25, .2)
  197. stick.BrickColor = BrickColor.new(1022)
  198. stick.Material = 'SmoothPlastic'
  199. stick.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+1.25, mouse.Hit.z) * CFrame.Angles(math.rad(math.random(-10,10)),math.rad(math.random(-10,10)),math.rad(math.random(-10,10)))
  200. Instance.new("CylinderMesh", stick).Scale = Vector3.new(.35, 1, .35)
  201. wait()
  202. local tail = stick:clone()
  203. tail.Mesh:Destroy()
  204. tail.Parent = stick
  205. tail.Anchored = true
  206. tail.Size = Vector3.new(.2, 1, .2)
  207. tail.BrickColor = BrickColor.new(217)
  208. tail.CFrame = stick.CFrame * CFrame.new(0, 1.05, 0)
  209. Instance.new("SpecialMesh", tail)
  210. end;
  211. ['Large stone - R'] = function(plr)
  212. local rock = Instance.new("Part", model)
  213. rock.FormFactor = 'Custom'
  214. rock.Material = "Slate"
  215. rock.Size = Vector3.new(math.random(4,7), math.random(4,7), math.random(4,7))
  216. rock.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  217. rock.CFrame = rock.CFrame * CFrame.Angles(math.random(1,4),math.random(1,4),math.random(1,4))
  218. end;
  219. ['Flower - H'] = function(plr)
  220. local flower = Instance.new("Part", model)
  221. flower.FormFactor = 'Custom'
  222. flower.Size = Vector3.new(1, 1, 1)
  223. flower.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.175, mouse.Hit.z) * CFrame.Angles(math.pi,0,0)
  224. flower.BrickColor = BrickColor.random()
  225. local mesh = Instance.new("SpecialMesh", flower)
  226. mesh.MeshId = "http://www.roblox.com/asset/?id=16659363"
  227. mesh.Scale = Vector3.new(.5, 1.5, .5)
  228. end;
  229. ['Small stone - P'] = function(plr)
  230. local rock = Instance.new("Part", model)
  231. rock.FormFactor = 'Custom'
  232. rock.Material = "Slate"
  233. rock.Size = Vector3.new(math.random(1,2), math.random(1,2), math.random(1,2))
  234. rock.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  235. rock.CFrame = rock.CFrame * CFrame.Angles(math.random(1,4),math.random(1,4),math.random(1,4))
  236. end;
  237. ['Nothing - X'] = function(plr)
  238. end;
  239. ['Dirt - F'] = function(plr)
  240. local dirt = Instance.new("Part", model)
  241. dirt.FormFactor = 'Custom'
  242. dirt.Material = "Grass"
  243. dirt.BrickColor = BrickColor.new(217)
  244. dirt.Size = Vector3.new(4, 1.5, 4)
  245. dirt.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z) * CFrame.Angles(0, math.rad(camera.CoordinateFrame.lookVector.x), 0)
  246. dirt.CFrame = dirt.CFrame * CFrame.Angles(math.rad(math.random(-10,10)),math.rad(math.random(-10,10)),math.rad(math.random(-10,10)))
  247. end;
  248. ['Grass plate - Z'] = function(plr)
  249. local plate = Instance.new("Part", model)
  250. plate.FormFactor = 'Custom'
  251. plate.Material = "Grass"
  252. plate.BrickColor = BrickColor.new(37)
  253. plate.Size = Vector3.new(4, .2+math.random()/4, 4)
  254. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  255. local mesh = Instance.new("BlockMesh", plate)
  256. mesh.Scale = Vector3.new(2, 1, 2)
  257. local sized = false
  258. mouse.Move:connect(function()
  259. if sized then return end
  260. size = (plate.Position - mouse.Hit.p).magnitude/2
  261. if size >= 20 then size = 20 end
  262. if size <= 2 then size = 2 end
  263. mesh.Scale = Vector3.new(size, 1, size)
  264. end)
  265. mouse.Button1Up:connect(function()
  266. if sized then return end
  267. sized = true
  268. size = (plate.Position - mouse.Hit.p).magnitude/2
  269. if size >= 20 then size = 20 end
  270. if size <= 2 then size = 2 end
  271. mesh.Scale = Vector3.new(size, 1, size)
  272. end)
  273. end;
  274. ['Sand plate - V'] = function(plr)
  275. local plate = Instance.new("Part", model)
  276. plate.FormFactor = 'Custom'
  277. plate.Material = "Sand"
  278. plate.BrickColor = BrickColor.new(226)
  279. plate.Size = Vector3.new(4, .2+math.random()/2, 4)
  280. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  281. local mesh = Instance.new("BlockMesh", plate)
  282. mesh.Scale = Vector3.new(2, 1, 2)
  283. local sized = false
  284. mouse.Move:connect(function()
  285. if sized then return end
  286. size = (plate.Position - mouse.Hit.p).magnitude/2
  287. if size >= 20 then size = 20 end
  288. if size <= 2 then size = 2 end
  289. mesh.Scale = Vector3.new(size, 1, size)
  290. end)
  291. mouse.Button1Up:connect(function()
  292. if sized then return end
  293. sized = true
  294. size = (plate.Position - mouse.Hit.p).magnitude/2
  295. if size >= 20 then size = 20 end
  296. if size <= 2 then size = 2 end
  297. mesh.Scale = Vector3.new(size, 1, size)
  298. end)
  299. end;
  300. ['Large tree - E'] = function(plr)
  301. GenerateTree(CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z), math.random(5,7), 1.5, math.random(5,7))
  302. end;
  303. ['Small tree - G'] = function(plr)
  304. GenerateTree(CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z), math.random(2,4), .75, math.random(2,3))
  305. end;
  306. ['Small grass - T'] = function(plr)
  307. local grass = Instance.new("Part", model)
  308. grass.FormFactor = 'Custom'
  309. grass.Size = Vector3.new(3,3,.4)
  310. grass.BrickColor = BrickColor.new(37)
  311. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y-3, mouse.Hit.z) * CFrame.Angles(math.rad(-90), 0, math.rad(90))
  312. coroutine.wrap(function()
  313. local grasscframe = grass.CFrame
  314. local val = 0
  315. while wait() do
  316. val = (val % 360) + 0.002
  317. grass.CFrame = grasscframe * CFrame.Angles(math.sin(val)*.05, math.sin(val)*.05, 0)
  318. end
  319. end)()
  320. local mesh = Instance.new("SpecialMesh", grass)
  321. mesh.MeshId = "http://www.roblox.com/asset/?id=1080954"
  322. mesh.Scale = Vector3.new(7, 7, 12)
  323. end;
  324. ['Tall grass - Y'] = function(plr)
  325. local grass = Instance.new("Part", model)
  326. grass.FormFactor = 'Custom'
  327. grass.Size = Vector3.new(3,3,.4)
  328. grass.BrickColor = BrickColor.new(37)
  329. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y-3, mouse.Hit.z) * CFrame.Angles(math.rad(-90), 0, math.rad(90))
  330. coroutine.wrap(function()
  331. local grasscframe = grass.CFrame
  332. local val = 0
  333. while wait() do
  334. val = (val % 360) + 0.002
  335. grass.CFrame = grasscframe * CFrame.Angles(math.sin(val)*.05, math.sin(val)*.05, 0)
  336. end
  337. end)()
  338. local mesh = Instance.new("SpecialMesh", grass)
  339. mesh.MeshId = "http://www.roblox.com/asset/?id=1080954"
  340. mesh.Scale = Vector3.new(3, 3, 22)
  341. end;
  342. ['Grass Patch - B'] = function(plr)
  343. for i = 1, math.random(3,6) do
  344. local pos = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z) * CFrame.Angles(0,math.random(-1,9),0)
  345. local patch = Instance.new("Part", model)
  346. patch.FormFactor = 'Custom'
  347. patch.Size = Vector3.new(.2, 5.5, .2)
  348. patch.BrickColor = BrickColor.new(37)
  349. patch.CanCollide = false
  350. patch.CFrame = pos * CFrame.new(0, -.75, 0) * CFrame.Angles(math.rad(math.random(-20,20)),math.rad(math.random(-20,20)),math.rad(math.random(-20,20)))
  351. Instance.new("SpecialMesh", patch).Scale = Vector3.new(.2, 1, .2)
  352. end
  353. end;
  354. ['Bunny - U'] = function(plr)
  355. local body = Instance.new("Part", model)
  356. body.BrickColor = BrickColor.new(1001)
  357. body.FormFactor = 'Custom'
  358. body.Size = Vector3.new(.7, .7, 1.8)
  359. body.Position = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  360. body.Rotation = Vector3.new(0, math.random(0, 360), 0)
  361. wait()
  362. local legs = body:clone()
  363. legs.Parent = body
  364. legs.Size = Vector3.new(1.1, .6, .8)
  365. legs.CFrame = body.CFrame * CFrame.new(0, -.1, -.3)
  366. local legs = body:clone()
  367. legs.Parent = body
  368. legs.Size = Vector3.new(1.1, .4, .5)
  369. legs.CFrame = body.CFrame * CFrame.new(0, -.25, .5) * CFrame.Angles(math.rad(10), 0, 0)
  370. local head = body:clone()
  371. head.Parent = body
  372. head.Size = Vector3.new(.5, .55, .55)
  373. head.CFrame = body.CFrame * CFrame.new(0, .45, .9)
  374. local ear1 = body:clone()
  375. ear1.Parent = body
  376. ear1.Size = Vector3.new(.2, .6, .2)
  377. ear1.CFrame = head.CFrame * CFrame.new(-.2, .4, 0) * CFrame.Angles(0, 0, math.rad(10))
  378. local ear2 = body:clone()
  379. ear2.Parent = body
  380. ear2.Size = Vector3.new(.2, .6, .2)
  381. ear2.CFrame = head.CFrame * CFrame.new(.2, .4, 0) * CFrame.Angles(0, 0, -math.rad(10))
  382. local tail = body:clone()
  383. tail.Parent = body
  384. tail.Size = Vector3.new(.4, .4, .4)
  385. tail.CFrame = body.CFrame * CFrame.new(0, 0, -1)
  386. end;
  387. ['Bird - M'] = function(plr)
  388. local body = Instance.new("Part", model)
  389. body.BrickColor = BrickColor.random()
  390. body.FormFactor = "Custom"
  391. body.Size = Vector3.new(.55,.55,.85)
  392. body.Position = Vector3.new(mouse.Hit.x, mouse.Hit.y+.3, mouse.Hit.z)
  393. body.Rotation = Vector3.new(0, math.random(0,360), 0)
  394. wait()
  395. local head = body:clone()
  396. head.Parent = body
  397. head.Size = Vector3.new(.4,.4,.4)
  398. head.CFrame = body.CFrame*CFrame.new(0,body.Size.y/1.5,body.Size.z/2+head.Size.z/6)
  399. local beak = body:clone()
  400. beak.Parent = body
  401. beak.BrickColor = BrickColor.new(106)
  402. beak.Size = Vector3.new(.2,.2,.3)
  403. beak.CFrame = head.CFrame*CFrame.new(0,-.05,head.Size.z/2+.1)
  404. local flap_or_no = math.random(0,1)
  405. if flap_or_no == 0 then
  406. local wings = body:clone()
  407. wings.Parent = body
  408. wings.Size = Vector3.new(.6, .45, .6)
  409. wings.CFrame = body.CFrame
  410. elseif flap_or_no == 1 then
  411. local wing1 = body:clone()
  412. wing1.Parent = body
  413. wing1.Size = Vector3.new(.2, .45, .6)
  414. wing1.CFrame = body.CFrame * CFrame.new(body.Size.x/1.5, .15, 0) * CFrame.Angles(0,0,math.rad(70))
  415. local wing2 = body:clone()
  416. wing2.Parent = body
  417. wing2.Size = Vector3.new(.2, .45, .6)
  418. wing2.CFrame = body.CFrame * CFrame.new(-body.Size.x/1.5, .15, 0) * CFrame.Angles(0,0,-math.rad(70))
  419. end
  420. end;
  421. ['Leaf plant - J'] = function(plr)
  422. local flower = Instance.new("Part", model)
  423. flower.FormFactor = 'Custom'
  424. flower.CanCollide = false
  425. flower.Size = Vector3.new(.2, .2, .2)
  426. flower.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+1.2, mouse.Hit.z) * CFrame.Angles(0, math.random(0,360), 0)
  427. local mesh = Instance.new("SpecialMesh", flower)
  428. mesh.MeshId = "http://www.roblox.com/asset/?id=1091940"
  429. mesh.TextureId = "http://www.roblox.com/asset/?id=1091942"
  430. mesh.Scale = Vector3.new(2, 2.1, 2)
  431. end;
  432. ['Path (Wooden) - K'] = function(plr)
  433. local plate = Instance.new("Part", model)
  434. plate.FormFactor = 'Custom'
  435. plate.Material = "Wood"
  436. plate.BrickColor = BrickColor.new(217)
  437. plate.Size = Vector3.new(4, .8, 4)
  438. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  439. local sized = false
  440. wait()
  441. local hit = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  442. local hit3 = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  443. mouse.Move:connect(function()
  444. if sized then return end
  445. size = (hit3-mouse.Hit.p).magnitude
  446. plate.Size = Vector3.new(4, .8, size)
  447. plate.CFrame = CFrame.new(hit3, mouse.Hit.p) * CFrame.new(0, 0, -size/2)
  448. end)
  449. mouse.Button1Up:connect(function()
  450. if sized then return end
  451. sized = true
  452. end)
  453. end;
  454. ['Path (Concrete) - RightCTRL + K'] = function(plr)
  455. local plate = Instance.new("Part", model)
  456. plate.FormFactor = 'Custom'
  457. plate.Material = "Concrete"
  458. plate.Size = Vector3.new(4, .8, 4)
  459. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  460. local sized = false
  461. wait()
  462. local hit = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  463. local hit3 = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  464. mouse.Move:connect(function()
  465. if sized then return end
  466. size = (hit3-mouse.Hit.p).magnitude
  467. plate.Size = Vector3.new(4, .8, size)
  468. plate.CFrame = CFrame.new(hit3, mouse.Hit.p) * CFrame.new(0, 0, -size/2)
  469. end)
  470. mouse.Button1Up:connect(function()
  471. if sized then return end
  472. sized = true
  473. end)
  474. end;
  475. ['Cloud - RightCTRL + C'] = function(plr)
  476. local cloud = Instance.new("Part", model)
  477. cloud.Size = Vector3.new(40, 10, 80)
  478. cloud.CanCollide = false
  479. cloud.BrickColor = BrickColor.new('White')
  480. cloud.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+80, mouse.Hit.z) * CFrame.Angles(math.rad(math.random(-10, 10)), math.pi/2, math.rad(math.random(-10, 10)))
  481. local specialmesh = Instance.new("SpecialMesh", cloud)
  482. specialmesh.Scale = Vector3.new(40, 10, 80)
  483. specialmesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  484. coroutine.wrap(function()
  485. local storedcframe = cloud.CFrame
  486. local value = 0
  487. while wait() do
  488. value = (value % 360) + math.random()/20
  489. cloud.CFrame = storedcframe * CFrame.new(0, math.sin(value)*.25, math.sin(value)*.55)
  490. end
  491. end)()
  492. end;
  493. ['Fountain - L'] = function(plr)
  494. local water = Instance.new("Part", model)
  495. water.Size = Vector3.new(2, 2, 16)
  496. water.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+7.25, mouse.Hit.z) * CFrame.Angles(math.pi/2, 0, 0)
  497. water.Transparency = .25
  498. water.CanCollide = false
  499. water.BrickColor = BrickColor.new(102)
  500. wait()
  501. local water2 = water:clone()
  502. water2.Parent = water
  503. water2.Size = Vector3.new(15, 6, 15)
  504. water2.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+7.25, mouse.Hit.z) * CFrame.Angles(0, 0, 0)
  505. water2.Transparency = .25
  506. water2.CanCollide = true
  507. water2.BrickColor = BrickColor.new(102)
  508. Instance.new("SpecialMesh", water2)
  509. local mesh = Instance.new("SpecialMesh", water)
  510. mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  511. mesh.Scale = Vector3.new(2, 2, 100)
  512. coroutine.wrap(function()
  513. local storedcframe = water.CFrame
  514. local value = 0
  515. while wait() do
  516. value = (value % 360) + math.random()/4
  517. water.CFrame = storedcframe * CFrame.new(0, 0, math.sin(value)*.25)
  518. water2.CFrame = water.CFrame * CFrame.new(0, 0, -8) * CFrame.Angles(-math.pi/2,0,0)
  519. end
  520. end)()
  521. end;
  522. ['Long plant - N'] = function(plr)
  523. local grass = Instance.new("Part", model)
  524. grass.FormFactor = 'Custom'
  525. grass.Size = Vector3.new(3, 7, 3)
  526. grass.CanCollide = false
  527. grass.BrickColor = BrickColor.new(37)
  528. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.85, mouse.Hit.z) * CFrame.Angles(0, math.random(), 0)
  529. local mesh = Instance.new('SpecialMesh', grass)
  530. mesh.MeshId = "http://www.roblox.com/asset/?id=25920418"
  531. mesh.TextureId = "http://www.roblox.com/asset/?id=25920406"
  532. mesh.Scale = Vector3.new(4, 6, 4)
  533. end;
  534.  
  535. }
  536.  
  537. mouse.KeyDown:connect(function(k)
  538. if k:lower() == "q" then
  539. currently = 'Puddle - Q'
  540. elseif k:lower() == "h" then
  541. currently = 'Flower - H'
  542. elseif k:lower() == "r" then
  543. currently = 'Large stone - R'
  544. elseif k:lower() == "p" then
  545. if combo == true then
  546. local persistscript = Instance.new("Script", game:service'Workspace')
  547. model.Parent = persistscript
  548. persistscript.Name = character.Name.."'s building"
  549. else
  550. currently = 'Small stone - P'
  551. end
  552. elseif k:lower() == "t" then
  553. currently = 'Small grass - T'
  554. elseif k:lower() == "g" then
  555. currently = 'Small tree - G'
  556. elseif k:lower() == 'c' then
  557. if combo then
  558. currently = 'Cloud - RightCTRL + C'
  559. else
  560. currently = 'Cattail - C'
  561. end
  562. elseif k:lower() == "u" then
  563. currently = 'Bunny - U'
  564. elseif k:lower() == "e" then
  565. currently = 'Large tree - E'
  566. elseif k:lower() == "j" then
  567. currently = 'Leaf plant - J'
  568. elseif k:lower() == "l" then
  569. if combo then
  570. stackable = not stackable
  571. else
  572. currently = 'Fountain - L'
  573. end
  574. elseif k:lower() == "f" then
  575. currently = 'Dirt - F'
  576. elseif k:lower() == "n" then
  577. currently = 'Long plant - N'
  578. elseif k:lower() == "k" then
  579. if combo == true then
  580. currently = 'Path (Concrete) - RightCTRL + K'
  581. else
  582. currently = 'Path (Wooden) - K'
  583. end
  584. elseif k:lower() == "y" then
  585. currently = 'Tall grass - Y'
  586. elseif k:lower() == "z" then
  587. currently = 'Grass plate - Z'
  588. elseif k:lower() == "v" then
  589. currently = 'Sand plate - V'
  590. elseif k:lower() == "b" then
  591. currently = 'Grass Patch - B'
  592. elseif k:lower() == "x" then
  593. currently = 'Nothing - X'
  594. elseif k:lower() == "m" then
  595. currently = 'Bird - M'
  596. elseif k:lower() == '0' then
  597. character.Humanoid.WalkSpeed = 50
  598. elseif k:lower() == '2' then
  599. eraser = true
  600. elseif k:lower() == '1' then
  601. combo = true
  602. end
  603. end)
  604.  
  605. mouse.KeyUp:connect(function(k)
  606. if k:lower() == '0' then
  607. character.Humanoid.WalkSpeed = 16
  608. elseif k:lower() == '2' then
  609. eraser = false
  610. elseif k:lower() == '1' then
  611. combo = false
  612. end
  613. end)
  614.  
  615. mouse.Button1Down:connect(function()
  616. if model then
  617. if eraser then
  618. local ray = Ray.new(camera.CoordinateFrame.p, (mouse.Hit.p - camera.CoordinateFrame.p))
  619. local hit, pos = workspace:FindPartOnRay(ray, hmm_something_suspicious)
  620. if hit and hit.Parent == model then
  621.  
  622. hit:Destroy()
  623. elseif hit and hit.Parent.Name == "Tree" then
  624. hit.Parent:Destroy()
  625. end
  626. else
  627. for index,func in pairs(Props) do
  628. if index == currently then
  629. func(plr)
  630. end
  631. end
  632. end
  633. end
  634. end)
  635.  
  636. local screengui = Instance.new("ScreenGui", plrgui)
  637. function AddText(text, name)
  638. local TextLabels = {}
  639. for i,v in pairs(screengui:children()) do
  640. if v:IsA'TextLabel' then
  641. table.insert(TextLabels, v)
  642. end
  643. end
  644.  
  645. local textl = Instance.new("TextLabel", screengui)
  646. textl.Text = text
  647. textl.Size = UDim2.new(.2, 0, 0, 15)
  648. textl.TextScaled = true
  649. textl.TextColor3 = Color3.new(1,1,1)
  650. textl.Position = UDim2.new(.6, 0, 0, #TextLabels*15)
  651. textl.BackgroundTransparency = .5
  652. textl.BackgroundColor3 = Color3.new()
  653. if name then
  654. textl.Name = name
  655. end
  656. end
  657. for i,v in pairs(Props) do
  658. AddText(i, i)
  659. wait()
  660. end
  661. AddText('Eraser - Hold CTRL', "Eraser")
  662. AddText('Persist built - RightCTRL + P')
  663. AddText('Items are stackable - RightCTRL + L', "StackableGui")
  664. wait()
  665. stackablegui = screengui:findFirstChild'StackableGui'
  666. erase = screengui:findFirstChild'Eraser'
  667. local currentgui
  668. while wait() do
  669. if screengui:findFirstChild(currently) and currentgui then
  670. if currently == currentgui.Name then
  671. currentgui.BackgroundColor3 = Color3.new(0,1,0)
  672. elseif currently ~= currentgui.Name then
  673. currentgui.BackgroundColor3 = Color3.new()
  674. end
  675. end
  676.  
  677. if erase then
  678. if eraser then
  679. erase.BackgroundColor3 = Color3.new(0,1,0)
  680. elseif not eraser then
  681. erase.BackgroundColor3 = Color3.new()
  682. end
  683. end
  684.  
  685. if stackablegui then
  686. if stackable then
  687. stackablegui.BackgroundColor3 = Color3.new(0,1,0)
  688. elseif not stackable then
  689. stackablegui.BackgroundColor3 = Color3.new()
  690. end
  691. end
  692. currentgui = screengui:findFirstChild(currently)
  693. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement