Advertisement
Jerrychan123

Untitled

Jun 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.70 KB | None | 0 0
  1. local plr = game:service'Players'.LocalPlayer
  2.  
  3. local character = plr.Character
  4.  
  5. local plrgui = plr:findFirstChild'PlayerGui'
  6.  
  7. local mouse = plr:GetMouse()
  8.  
  9. local camera = workspace.CurrentCamera
  10.  
  11. --
  12.  
  13.  
  14.  
  15. game:service'Lighting'.Outlines = false --bad outlines
  16.  
  17.  
  18.  
  19. --
  20.  
  21. local eraser = false
  22.  
  23. local combo = false
  24.  
  25. local stackable = false
  26.  
  27. --
  28.  
  29. local model = Instance.new("Model", character)
  30.  
  31. model.Name = "Build"
  32.  
  33. model.ChildAdded:connect(function(object)
  34.  
  35. if model.Parent ~= workspace then
  36.  
  37. model.Parent = workspace
  38.  
  39. end
  40.  
  41. if object:IsA'Part' then
  42.  
  43. object.Anchored = true
  44.  
  45. object.Locked = true
  46.  
  47. object.TopSurface = 0
  48.  
  49. object.BottomSurface = 0
  50.  
  51. if stackable then
  52.  
  53. wait()
  54.  
  55. local x,y,z = object.CFrame:toEulerAnglesXYZ()
  56.  
  57. local ray = Ray.new(camera.CoordinateFrame.p, (mouse.Hit.p - camera.CoordinateFrame.p))
  58.  
  59. local hit, pos = workspace:findPartOnRay(ray, lolno_dis_stands_for_nutin)
  60.  
  61. if hit and pos then
  62.  
  63. object.CFrame = CFrame.new(pos.x, pos.y, pos.z) * CFrame.Angles(x,y,z)
  64.  
  65. end
  66.  
  67. end
  68.  
  69. end
  70.  
  71. end)
  72.  
  73. -- GenerateTree(location, complexity, width, height)
  74.  
  75. do
  76.  
  77. --[[
  78.  
  79.  
  80.  
  81. _G.GenerateTree (location, complexity, width, height)
  82.  
  83.  
  84.  
  85. Procedurally generates neat-looking trees of various sizes and shapes.
  86.  
  87.  
  88.  
  89. Arguments:
  90.  
  91.  
  92.  
  93. location: position tree will "sprout" out of
  94.  
  95. complexity: # of times to branch out
  96.  
  97. determines overall size and quality of tree
  98.  
  99. produces between m^c+(m^(c+1)-1)/(m-1) parts,
  100.  
  101. where c is complexity,
  102.  
  103. and m is either the min or max # of possible branches
  104.  
  105. (currently, both min and max are 2)
  106.  
  107. width: initial x/z size of tree base
  108.  
  109. determines overall thickness of tree
  110.  
  111. height: initial y size of tree base
  112.  
  113. contributes to sparseness of tree
  114.  
  115.  
  116.  
  117. ]]
  118.  
  119.  
  120.  
  121. -- TODO: prevent overcrowding of branches
  122.  
  123.  
  124.  
  125. local Base = Instance.new("Part")
  126.  
  127. Base.Name = "Trunk"
  128.  
  129. Base.formFactor = "Custom"
  130.  
  131. Base.TopSurface = 0
  132.  
  133. Base.BottomSurface = 0
  134.  
  135. Base.Anchored = true
  136.  
  137. Base.Locked = true
  138.  
  139. Base.BrickColor = BrickColor.new(217)
  140.  
  141. local Leaves = Base:Clone()
  142.  
  143. Leaves.Name = "Leaves"
  144.  
  145. Leaves.CanCollide = false
  146.  
  147. Leaves.Material = "Grass"
  148.  
  149. Leaves.BrickColor = BrickColor.new(37)
  150.  
  151. Instance.new("CylinderMesh",Base)
  152.  
  153.  
  154.  
  155.  
  156.  
  157. -- get dot product of yz angles
  158.  
  159. function dot(c1,c2)
  160.  
  161. local m = CFrame.Angles(math.pi/2,0,0)
  162.  
  163. return (c1*m).lookVector:Dot((c2*m).lookVector)
  164.  
  165. end
  166.  
  167.  
  168.  
  169. -- multiplier for various sizes of foliage
  170.  
  171. local leaf_mult = {
  172.  
  173. Vector3.new(1.5,1.5,1.2);
  174.  
  175. Vector3.new(1.5,1,1.5);
  176.  
  177. Vector3.new(1.2,1.5,1.5);
  178.  
  179. Vector3.new(1.5,1.5,1.5);
  180.  
  181. }
  182.  
  183.  
  184.  
  185. function Branch(base,c)
  186.  
  187. if c <= 0 then
  188.  
  189. -- if the complexity has run out, generate some foliage
  190.  
  191. local leaves = Leaves:Clone()
  192.  
  193. local vol = base.Size.x+base.Size.y+base.Size.z -- determine size based on branch size
  194.  
  195. leaves.Size = leaf_mult[math.random(1,#leaf_mult)]*math.random(vol/3*10,vol/3*12)/10
  196.  
  197. leaves.CFrame = base.CFrame * CFrame.new(0,base.Size.y/2,0) -- center foliage at top of branch
  198.  
  199. leaves.Parent = base.Parent
  200.  
  201. else
  202.  
  203. -- otherwise, make some more branches
  204.  
  205. local pos = base.CFrame*CFrame.new(0,base.Size/2,0)
  206.  
  207. local height = base.Size.y
  208.  
  209. local width = base.Size.x
  210.  
  211. local nb = math.random(2,2) -- # of possible branches (2 seems to work fine for now)
  212.  
  213. local r = math.random(45,135) -- rotation of branches on y axis
  214.  
  215.  
  216.  
  217. -- branch split angle difference
  218.  
  219. -- the less complexity, the greater the possible angle
  220.  
  221. -- minimum: 20-75; maximum: 40-80
  222.  
  223. local da = math.random(20+55/c,40+40/c)
  224.  
  225.  
  226.  
  227. -- branch angle (overall angle of all branches)
  228.  
  229. local ba = math.random(-da/3,da/3)
  230.  
  231.  
  232.  
  233. -- ba+da/2 shouldn't be near or greater than 90 degrees
  234.  
  235.  
  236.  
  237. for i=0,nb-1 do -- for each branch
  238.  
  239. local branch = base:Clone()
  240.  
  241. branch.Name = "Branch"
  242.  
  243. local h = height*math.random(95,115)/100 -- height .95 to 1.15 of original
  244.  
  245.  
  246.  
  247. -- make new cframe
  248.  
  249. -- move new to top of base, then apply branch angle (ba)
  250.  
  251. local new = branch.CFrame * CFrame.new(0,height/2,0) * CFrame.Angles(0,0,math.rad(ba))
  252.  
  253. -- next, rotate branch so that it faces away from others, also apply overall rotation (r)
  254.  
  255. -- also, apply the split angle (da)
  256.  
  257. -- finally, move branch upward by half it's size
  258.  
  259. new = new * CFrame.Angles(0,i*(math.pi*2/nb)+r,math.rad(da/2)) * CFrame.new(0,h/2,0)
  260.  
  261.  
  262.  
  263. -- determine width by branch's final angle; greater the angle, smaller the width
  264.  
  265. -- also shave off a bit of width for more dramatic change in size
  266.  
  267. -- a frustum cone mesh would really help here
  268.  
  269. local w = dot(new,branch.CFrame)*width*0.9
  270.  
  271.  
  272.  
  273. branch.Size = Vector3.new(w,h,w)
  274.  
  275. branch.CFrame = new
  276.  
  277. branch.Parent = base.Parent
  278.  
  279.  
  280.  
  281. -- create the next set of branches with one less complexity
  282.  
  283. Branch(branch,c-1)
  284.  
  285. end
  286.  
  287. end
  288.  
  289. end
  290.  
  291.  
  292.  
  293.  
  294.  
  295. -- Main Function ----------------
  296.  
  297. function GenerateTree(location,complexity,width,height)
  298.  
  299. local tree = Instance.new("Model")
  300.  
  301. tree.Name = "Tree"
  302.  
  303. tree.Parent = model
  304.  
  305. local base = Base:Clone()
  306.  
  307. base.Parent = tree
  308.  
  309. base.Size = Vector3.new(width,height,width)
  310.  
  311. base.CFrame = location * CFrame.new(0,height/2,0) * CFrame.Angles(0,math.rad(math.random(1,360)),0)
  312.  
  313. Branch(base,complexity)
  314.  
  315. return tree
  316.  
  317. end
  318.  
  319.  
  320.  
  321. end
  322.  
  323. --
  324.  
  325. currently = 'Nothing - X'
  326.  
  327. Props = {
  328.  
  329.  
  330.  
  331. ['Puddle - Q'] = function(plr)
  332.  
  333. local puddle = Instance.new("Part", model)
  334.  
  335. puddle.FormFactor = 'Custom'
  336.  
  337. puddle.Size = Vector3.new(2, .4, 2)
  338.  
  339. puddle.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.05, mouse.Hit.z)
  340.  
  341. puddle.CanCollide = false
  342.  
  343. puddle.BrickColor = BrickColor.new(102)
  344.  
  345. puddle.Transparency = .2
  346.  
  347. local mesh = Instance.new("CylinderMesh", puddle)
  348.  
  349. mesh.Scale = Vector3.new(2, 1.05, 2)
  350.  
  351. local sized = false
  352.  
  353. mouse.Move:connect(function()
  354.  
  355. if sized then return end
  356.  
  357. size = (puddle.Position - mouse.Hit.p).magnitude
  358.  
  359. if size >= 30 then size = 30 end
  360.  
  361. if size <= 2 then size = 2 end
  362.  
  363. mesh.Scale = Vector3.new(size, 1.05, size)
  364.  
  365. end)
  366.  
  367. mouse.Button1Up:connect(function()
  368.  
  369. if sized then return end
  370.  
  371. sized = true
  372.  
  373. size = (puddle.Position - mouse.Hit.p).magnitude
  374.  
  375. if size >= 30 then size = 30 end
  376.  
  377. if size <= 2 then size = 2 end
  378.  
  379. mesh.Scale = Vector3.new(size, 1.05, size)
  380.  
  381. end)
  382.  
  383. end;
  384.  
  385. ['Cattail - C'] = function(plr)
  386.  
  387. local stick = Instance.new("Part", model)
  388.  
  389. stick.FormFactor = 'Custom'
  390.  
  391. stick.Size = Vector3.new(.2, 3.25, .2)
  392.  
  393. stick.BrickColor = BrickColor.new(1022)
  394.  
  395. stick.Material = 'SmoothPlastic'
  396.  
  397. 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)))
  398.  
  399. Instance.new("CylinderMesh", stick).Scale = Vector3.new(.35, 1, .35)
  400.  
  401. wait()
  402.  
  403. local tail = stick:clone()
  404.  
  405. tail.Mesh:Destroy()
  406.  
  407. tail.Parent = stick
  408.  
  409. tail.Anchored = true
  410.  
  411. tail.Size = Vector3.new(.2, 1, .2)
  412.  
  413. tail.BrickColor = BrickColor.new(217)
  414.  
  415. tail.CFrame = stick.CFrame * CFrame.new(0, 1.05, 0)
  416.  
  417. Instance.new("SpecialMesh", tail)
  418.  
  419. end;
  420.  
  421. ['Large stone - R'] = function(plr)
  422.  
  423. local rock = Instance.new("Part", model)
  424.  
  425. rock.FormFactor = 'Custom'
  426.  
  427. rock.Material = "Slate"
  428.  
  429. rock.Size = Vector3.new(math.random(4,7), math.random(4,7), math.random(4,7))
  430.  
  431. rock.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  432.  
  433. rock.CFrame = rock.CFrame * CFrame.Angles(math.random(1,4),math.random(1,4),math.random(1,4))
  434.  
  435. end;
  436.  
  437. ['Flower - H'] = function(plr)
  438.  
  439. local flower = Instance.new("Part", model)
  440.  
  441. flower.FormFactor = 'Custom'
  442.  
  443. flower.Size = Vector3.new(1, 1, 1)
  444.  
  445. flower.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.175, mouse.Hit.z) * CFrame.Angles(math.pi,0,0)
  446.  
  447. flower.BrickColor = BrickColor.random()
  448.  
  449. local mesh = Instance.new("SpecialMesh", flower)
  450.  
  451. mesh.MeshId = "http://www.roblox.com/asset/?id=16659363"
  452.  
  453. mesh.Scale = Vector3.new(.5, 1.5, .5)
  454.  
  455. end;
  456.  
  457. ['Small stone - P'] = function(plr)
  458.  
  459. local rock = Instance.new("Part", model)
  460.  
  461. rock.FormFactor = 'Custom'
  462.  
  463. rock.Material = "Slate"
  464.  
  465. rock.Size = Vector3.new(math.random(1,2), math.random(1,2), math.random(1,2))
  466.  
  467. rock.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  468.  
  469. rock.CFrame = rock.CFrame * CFrame.Angles(math.random(1,4),math.random(1,4),math.random(1,4))
  470.  
  471. end;
  472.  
  473. ['Nothing - X'] = function(plr)
  474.  
  475. end;
  476.  
  477. ['Dirt - F'] = function(plr)
  478.  
  479. local dirt = Instance.new("Part", model)
  480.  
  481. dirt.FormFactor = 'Custom'
  482.  
  483. dirt.Material = "Grass"
  484.  
  485. dirt.BrickColor = BrickColor.new(217)
  486.  
  487. dirt.Size = Vector3.new(4, 1.5, 4)
  488.  
  489. dirt.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z) * CFrame.Angles(0, math.rad(camera.CoordinateFrame.lookVector.x), 0)
  490.  
  491. dirt.CFrame = dirt.CFrame * CFrame.Angles(math.rad(math.random(-10,10)),math.rad(math.random(-10,10)),math.rad(math.random(-10,10)))
  492.  
  493. end;
  494.  
  495. ['Grass plate - Z'] = function(plr)
  496.  
  497. local plate = Instance.new("Part", model)
  498.  
  499. plate.FormFactor = 'Custom'
  500.  
  501. plate.Material = "Grass"
  502.  
  503. plate.BrickColor = BrickColor.new(37)
  504.  
  505. plate.Size = Vector3.new(4, .2+math.random()/4, 4)
  506.  
  507. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  508.  
  509. local mesh = Instance.new("BlockMesh", plate)
  510.  
  511. mesh.Scale = Vector3.new(2, 1, 2)
  512.  
  513. local sized = false
  514.  
  515. mouse.Move:connect(function()
  516.  
  517. if sized then return end
  518.  
  519. size = (plate.Position - mouse.Hit.p).magnitude/2
  520.  
  521. if size >= 20 then size = 20 end
  522.  
  523. if size <= 2 then size = 2 end
  524.  
  525. mesh.Scale = Vector3.new(size, 1, size)
  526.  
  527. end)
  528.  
  529. mouse.Button1Up:connect(function()
  530.  
  531. if sized then return end
  532.  
  533. sized = true
  534.  
  535. size = (plate.Position - mouse.Hit.p).magnitude/2
  536.  
  537. if size >= 20 then size = 20 end
  538.  
  539. if size <= 2 then size = 2 end
  540.  
  541. mesh.Scale = Vector3.new(size, 1, size)
  542.  
  543. end)
  544.  
  545. end;
  546.  
  547. ['Sand plate - V'] = function(plr)
  548.  
  549. local plate = Instance.new("Part", model)
  550.  
  551. plate.FormFactor = 'Custom'
  552.  
  553. plate.Material = "Sand"
  554.  
  555. plate.BrickColor = BrickColor.new(226)
  556.  
  557. plate.Size = Vector3.new(4, .2+math.random()/2, 4)
  558.  
  559. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  560.  
  561. local mesh = Instance.new("BlockMesh", plate)
  562.  
  563. mesh.Scale = Vector3.new(2, 1, 2)
  564.  
  565. local sized = false
  566.  
  567. mouse.Move:connect(function()
  568.  
  569. if sized then return end
  570.  
  571. size = (plate.Position - mouse.Hit.p).magnitude/2
  572.  
  573. if size >= 20 then size = 20 end
  574.  
  575. if size <= 2 then size = 2 end
  576.  
  577. mesh.Scale = Vector3.new(size, 1, size)
  578.  
  579. end)
  580.  
  581. mouse.Button1Up:connect(function()
  582.  
  583. if sized then return end
  584.  
  585. sized = true
  586.  
  587. size = (plate.Position - mouse.Hit.p).magnitude/2
  588.  
  589. if size >= 20 then size = 20 end
  590.  
  591. if size <= 2 then size = 2 end
  592.  
  593. mesh.Scale = Vector3.new(size, 1, size)
  594.  
  595. end)
  596.  
  597. end;
  598.  
  599. ['Large tree - E'] = function(plr)
  600.  
  601. GenerateTree(CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z), math.random(5,7), 1.5, math.random(5,7))
  602.  
  603. end;
  604.  
  605. ['Small tree - G'] = function(plr)
  606.  
  607. GenerateTree(CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z), math.random(2,4), .75, math.random(2,3))
  608.  
  609. end;
  610.  
  611. ['Small grass - T'] = function(plr)
  612.  
  613. local grass = Instance.new("Part", model)
  614.  
  615. grass.FormFactor = 'Custom'
  616.  
  617. grass.Size = Vector3.new(3,3,.4)
  618.  
  619. grass.BrickColor = BrickColor.new(37)
  620.  
  621. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y-3, mouse.Hit.z) * CFrame.Angles(math.rad(-90), 0, math.rad(90))
  622.  
  623. coroutine.wrap(function()
  624.  
  625. local grasscframe = grass.CFrame
  626.  
  627. local val = 0
  628.  
  629. while wait() do
  630.  
  631. val = (val % 360) + 0.002
  632.  
  633. grass.CFrame = grasscframe * CFrame.Angles(math.sin(val)*.05, math.sin(val)*.05, 0)
  634.  
  635. end
  636.  
  637. end)()
  638.  
  639. local mesh = Instance.new("SpecialMesh", grass)
  640.  
  641. mesh.MeshId = "http://www.roblox.com/asset/?id=1080954"
  642.  
  643. mesh.Scale = Vector3.new(7, 7, 12)
  644.  
  645. end;
  646.  
  647. ['Tall grass - Y'] = function(plr)
  648.  
  649. local grass = Instance.new("Part", model)
  650.  
  651. grass.FormFactor = 'Custom'
  652.  
  653. grass.Size = Vector3.new(3,3,.4)
  654.  
  655. grass.BrickColor = BrickColor.new(37)
  656.  
  657. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y-3, mouse.Hit.z) * CFrame.Angles(math.rad(-90), 0, math.rad(90))
  658.  
  659. coroutine.wrap(function()
  660.  
  661. local grasscframe = grass.CFrame
  662.  
  663. local val = 0
  664.  
  665. while wait() do
  666.  
  667. val = (val % 360) + 0.002
  668.  
  669. grass.CFrame = grasscframe * CFrame.Angles(math.sin(val)*.05, math.sin(val)*.05, 0)
  670.  
  671. end
  672.  
  673. end)()
  674.  
  675. local mesh = Instance.new("SpecialMesh", grass)
  676.  
  677. mesh.MeshId = "http://www.roblox.com/asset/?id=1080954"
  678.  
  679. mesh.Scale = Vector3.new(3, 3, 22)
  680.  
  681. end;
  682.  
  683. ['Grass Patch - B'] = function(plr)
  684.  
  685. for i = 1, math.random(3,6) do
  686.  
  687. local pos = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z) * CFrame.Angles(0,math.random(-1,9),0)
  688.  
  689. local patch = Instance.new("Part", model)
  690.  
  691. patch.FormFactor = 'Custom'
  692.  
  693. patch.Size = Vector3.new(.2, 5.5, .2)
  694.  
  695. patch.BrickColor = BrickColor.new(37)
  696.  
  697. patch.CanCollide = false
  698.  
  699. 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)))
  700.  
  701. Instance.new("SpecialMesh", patch).Scale = Vector3.new(.2, 1, .2)
  702.  
  703. end
  704.  
  705. end;
  706.  
  707. ['Bunny - U'] = function(plr)
  708.  
  709. local body = Instance.new("Part", model)
  710.  
  711. body.BrickColor = BrickColor.new(1001)
  712.  
  713. body.FormFactor = 'Custom'
  714.  
  715. body.Size = Vector3.new(.7, .7, 1.8)
  716.  
  717. body.Position = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  718.  
  719. body.Rotation = Vector3.new(0, math.random(0, 360), 0)
  720.  
  721. wait()
  722.  
  723. local legs = body:clone()
  724.  
  725. legs.Parent = body
  726.  
  727. legs.Size = Vector3.new(1.1, .6, .8)
  728.  
  729. legs.CFrame = body.CFrame * CFrame.new(0, -.1, -.3)
  730.  
  731. local legs = body:clone()
  732.  
  733. legs.Parent = body
  734.  
  735. legs.Size = Vector3.new(1.1, .4, .5)
  736.  
  737. legs.CFrame = body.CFrame * CFrame.new(0, -.25, .5) * CFrame.Angles(math.rad(10), 0, 0)
  738.  
  739. local head = body:clone()
  740.  
  741. head.Parent = body
  742.  
  743. head.Size = Vector3.new(.5, .55, .55)
  744.  
  745. head.CFrame = body.CFrame * CFrame.new(0, .45, .9)
  746.  
  747. local ear1 = body:clone()
  748.  
  749. ear1.Parent = body
  750.  
  751. ear1.Size = Vector3.new(.2, .6, .2)
  752.  
  753. ear1.CFrame = head.CFrame * CFrame.new(-.2, .4, 0) * CFrame.Angles(0, 0, math.rad(10))
  754.  
  755. local ear2 = body:clone()
  756.  
  757. ear2.Parent = body
  758.  
  759. ear2.Size = Vector3.new(.2, .6, .2)
  760.  
  761. ear2.CFrame = head.CFrame * CFrame.new(.2, .4, 0) * CFrame.Angles(0, 0, -math.rad(10))
  762.  
  763. local tail = body:clone()
  764.  
  765. tail.Parent = body
  766.  
  767. tail.Size = Vector3.new(.4, .4, .4)
  768.  
  769. tail.CFrame = body.CFrame * CFrame.new(0, 0, -1)
  770.  
  771. end;
  772.  
  773. ['Bird - M'] = function(plr)
  774.  
  775. local body = Instance.new("Part", model)
  776.  
  777. body.BrickColor = BrickColor.random()
  778.  
  779. body.FormFactor = "Custom"
  780.  
  781. body.Size = Vector3.new(.55,.55,.85)
  782.  
  783. body.Position = Vector3.new(mouse.Hit.x, mouse.Hit.y+.3, mouse.Hit.z)
  784.  
  785. body.Rotation = Vector3.new(0, math.random(0,360), 0)
  786.  
  787. wait()
  788.  
  789. local head = body:clone()
  790.  
  791. head.Parent = body
  792.  
  793. head.Size = Vector3.new(.4,.4,.4)
  794.  
  795. head.CFrame = body.CFrame*CFrame.new(0,body.Size.y/1.5,body.Size.z/2+head.Size.z/6)
  796.  
  797. local beak = body:clone()
  798.  
  799. beak.Parent = body
  800.  
  801. beak.BrickColor = BrickColor.new(106)
  802.  
  803. beak.Size = Vector3.new(.2,.2,.3)
  804.  
  805. beak.CFrame = head.CFrame*CFrame.new(0,-.05,head.Size.z/2+.1)
  806.  
  807. local flap_or_no = math.random(0,1)
  808.  
  809. if flap_or_no == 0 then
  810.  
  811. local wings = body:clone()
  812.  
  813. wings.Parent = body
  814.  
  815. wings.Size = Vector3.new(.6, .45, .6)
  816.  
  817. wings.CFrame = body.CFrame
  818.  
  819. elseif flap_or_no == 1 then
  820.  
  821. local wing1 = body:clone()
  822.  
  823. wing1.Parent = body
  824.  
  825. wing1.Size = Vector3.new(.2, .45, .6)
  826.  
  827. wing1.CFrame = body.CFrame * CFrame.new(body.Size.x/1.5, .15, 0) * CFrame.Angles(0,0,math.rad(70))
  828.  
  829. local wing2 = body:clone()
  830.  
  831. wing2.Parent = body
  832.  
  833. wing2.Size = Vector3.new(.2, .45, .6)
  834.  
  835. wing2.CFrame = body.CFrame * CFrame.new(-body.Size.x/1.5, .15, 0) * CFrame.Angles(0,0,-math.rad(70))
  836.  
  837. end
  838.  
  839. end;
  840.  
  841. ['Leaf plant - J'] = function(plr)
  842.  
  843. local flower = Instance.new("Part", model)
  844.  
  845. flower.FormFactor = 'Custom'
  846.  
  847. flower.CanCollide = false
  848.  
  849. flower.Size = Vector3.new(.2, .2, .2)
  850.  
  851. flower.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+1.2, mouse.Hit.z) * CFrame.Angles(0, math.random(0,360), 0)
  852.  
  853. local mesh = Instance.new("SpecialMesh", flower)
  854.  
  855. mesh.MeshId = "http://www.roblox.com/asset/?id=1091940"
  856.  
  857. mesh.TextureId = "http://www.roblox.com/asset/?id=1091942"
  858.  
  859. mesh.Scale = Vector3.new(2, 2.1, 2)
  860.  
  861. end;
  862.  
  863. ['Path (Wooden) - K'] = function(plr)
  864.  
  865. local plate = Instance.new("Part", model)
  866.  
  867. plate.FormFactor = 'Custom'
  868.  
  869. plate.Material = "Wood"
  870.  
  871. plate.BrickColor = BrickColor.new(217)
  872.  
  873. plate.Size = Vector3.new(4, .8, 4)
  874.  
  875. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  876.  
  877. local sized = false
  878.  
  879. wait()
  880.  
  881. local hit = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  882.  
  883. local hit3 = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  884.  
  885. mouse.Move:connect(function()
  886.  
  887. if sized then return end
  888.  
  889. size = (hit3-mouse.Hit.p).magnitude
  890.  
  891. plate.Size = Vector3.new(4, .8, size)
  892.  
  893. plate.CFrame = CFrame.new(hit3, mouse.Hit.p) * CFrame.new(0, 0, -size/2)
  894.  
  895. end)
  896.  
  897. mouse.Button1Up:connect(function()
  898.  
  899. if sized then return end
  900.  
  901. sized = true
  902.  
  903. end)
  904.  
  905. end;
  906.  
  907. ['Path (Concrete) - RightCTRL + K'] = function(plr)
  908.  
  909. local plate = Instance.new("Part", model)
  910.  
  911. plate.FormFactor = 'Custom'
  912.  
  913. plate.Material = "Concrete"
  914.  
  915. plate.Size = Vector3.new(4, .8, 4)
  916.  
  917. plate.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  918.  
  919. local sized = false
  920.  
  921. wait()
  922.  
  923. local hit = CFrame.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  924.  
  925. local hit3 = Vector3.new(mouse.Hit.x, mouse.Hit.y, mouse.Hit.z)
  926.  
  927. mouse.Move:connect(function()
  928.  
  929. if sized then return end
  930.  
  931. size = (hit3-mouse.Hit.p).magnitude
  932.  
  933. plate.Size = Vector3.new(4, .8, size)
  934.  
  935. plate.CFrame = CFrame.new(hit3, mouse.Hit.p) * CFrame.new(0, 0, -size/2)
  936.  
  937. end)
  938.  
  939. mouse.Button1Up:connect(function()
  940.  
  941. if sized then return end
  942.  
  943. sized = true
  944.  
  945. end)
  946.  
  947. end;
  948.  
  949. ['Cloud - RightCTRL + C'] = function(plr)
  950.  
  951. local cloud = Instance.new("Part", model)
  952.  
  953. cloud.Size = Vector3.new(40, 10, 80)
  954.  
  955. cloud.CanCollide = false
  956.  
  957. cloud.BrickColor = BrickColor.new('White')
  958.  
  959. 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)))
  960.  
  961. local specialmesh = Instance.new("SpecialMesh", cloud)
  962.  
  963. specialmesh.Scale = Vector3.new(40, 10, 80)
  964.  
  965. specialmesh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  966.  
  967. coroutine.wrap(function()
  968.  
  969. local storedcframe = cloud.CFrame
  970.  
  971. local value = 0
  972.  
  973. while wait() do
  974.  
  975. value = (value % 360) + math.random()/20
  976.  
  977. cloud.CFrame = storedcframe * CFrame.new(0, math.sin(value)*.25, math.sin(value)*.55)
  978.  
  979. end
  980.  
  981. end)()
  982.  
  983. end;
  984.  
  985. ['Fountain - L'] = function(plr)
  986.  
  987. local water = Instance.new("Part", model)
  988.  
  989. water.Size = Vector3.new(2, 2, 16)
  990.  
  991. water.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+7.25, mouse.Hit.z) * CFrame.Angles(math.pi/2, 0, 0)
  992.  
  993. water.Transparency = .25
  994.  
  995. water.CanCollide = false
  996.  
  997. water.BrickColor = BrickColor.new(102)
  998.  
  999. wait()
  1000.  
  1001. local water2 = water:clone()
  1002.  
  1003. water2.Parent = water
  1004.  
  1005. water2.Size = Vector3.new(15, 6, 15)
  1006.  
  1007. water2.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+7.25, mouse.Hit.z) * CFrame.Angles(0, 0, 0)
  1008.  
  1009. water2.Transparency = .25
  1010.  
  1011. water2.CanCollide = true
  1012.  
  1013. water2.BrickColor = BrickColor.new(102)
  1014.  
  1015. Instance.new("SpecialMesh", water2)
  1016.  
  1017. local mesh = Instance.new("SpecialMesh", water)
  1018.  
  1019. mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
  1020.  
  1021. mesh.Scale = Vector3.new(2, 2, 100)
  1022.  
  1023. coroutine.wrap(function()
  1024.  
  1025. local storedcframe = water.CFrame
  1026.  
  1027. local value = 0
  1028.  
  1029. while wait() do
  1030.  
  1031. value = (value % 360) + math.random()/4
  1032.  
  1033. water.CFrame = storedcframe * CFrame.new(0, 0, math.sin(value)*.25)
  1034.  
  1035. water2.CFrame = water.CFrame * CFrame.new(0, 0, -8) * CFrame.Angles(-math.pi/2,0,0)
  1036.  
  1037. end
  1038.  
  1039. end)()
  1040.  
  1041. end;
  1042.  
  1043. ['Long plant - N'] = function(plr)
  1044.  
  1045. local grass = Instance.new("Part", model)
  1046.  
  1047. grass.FormFactor = 'Custom'
  1048.  
  1049. grass.Size = Vector3.new(3, 7, 3)
  1050.  
  1051. grass.CanCollide = false
  1052.  
  1053. grass.BrickColor = BrickColor.new(37)
  1054.  
  1055. grass.CFrame = CFrame.new(mouse.Hit.x, mouse.Hit.y+.85, mouse.Hit.z) * CFrame.Angles(0, math.random(), 0)
  1056.  
  1057. local mesh = Instance.new('SpecialMesh', grass)
  1058.  
  1059. mesh.MeshId = "http://www.roblox.com/asset/?id=25920418"
  1060.  
  1061. mesh.TextureId = "http://www.roblox.com/asset/?id=25920406"
  1062.  
  1063. mesh.Scale = Vector3.new(4, 6, 4)
  1064.  
  1065. end;
  1066.  
  1067.  
  1068.  
  1069. }
  1070.  
  1071.  
  1072.  
  1073. mouse.KeyDown:connect(function(k)
  1074.  
  1075. if k:lower() == "q" then
  1076.  
  1077. currently = 'Puddle - Q'
  1078.  
  1079. elseif k:lower() == "h" then
  1080.  
  1081. currently = 'Flower - H'
  1082.  
  1083. elseif k:lower() == "r" then
  1084.  
  1085. currently = 'Large stone - R'
  1086.  
  1087. elseif k:lower() == "p" then
  1088.  
  1089. if combo == true then
  1090.  
  1091. local persistscript = Instance.new("Script", game:service'Workspace')
  1092.  
  1093. model.Parent = persistscript
  1094.  
  1095. persistscript.Name = character.Name.."'s building"
  1096.  
  1097. else
  1098.  
  1099. currently = 'Small stone - P'
  1100.  
  1101. end
  1102.  
  1103. elseif k:lower() == "t" then
  1104.  
  1105. currently = 'Small grass - T'
  1106.  
  1107. elseif k:lower() == "g" then
  1108.  
  1109. currently = 'Small tree - G'
  1110.  
  1111. elseif k:lower() == 'c' then
  1112.  
  1113. if combo then
  1114.  
  1115. currently = 'Cloud - RightCTRL + C'
  1116.  
  1117. else
  1118.  
  1119. currently = 'Cattail - C'
  1120.  
  1121. end
  1122.  
  1123. elseif k:lower() == "u" then
  1124.  
  1125. currently = 'Bunny - U'
  1126.  
  1127. elseif k:lower() == "e" then
  1128.  
  1129. currently = 'Large tree - E'
  1130.  
  1131. elseif k:lower() == "j" then
  1132.  
  1133. currently = 'Leaf plant - J'
  1134.  
  1135. elseif k:lower() == "l" then
  1136.  
  1137. if combo then
  1138.  
  1139. stackable = not stackable
  1140.  
  1141. else
  1142.  
  1143. currently = 'Fountain - L'
  1144.  
  1145. end
  1146.  
  1147. elseif k:lower() == "f" then
  1148.  
  1149. currently = 'Dirt - F'
  1150.  
  1151. elseif k:lower() == "n" then
  1152.  
  1153. currently = 'Long plant - N'
  1154.  
  1155. elseif k:lower() == "k" then
  1156.  
  1157. if combo == true then
  1158.  
  1159. currently = 'Path (Concrete) - RightCTRL + K'
  1160.  
  1161. else
  1162.  
  1163. currently = 'Path (Wooden) - K'
  1164.  
  1165. end
  1166.  
  1167. elseif k:lower() == "y" then
  1168.  
  1169. currently = 'Tall grass - Y'
  1170.  
  1171. elseif k:lower() == "z" then
  1172.  
  1173. currently = 'Grass plate - Z'
  1174.  
  1175. elseif k:lower() == "v" then
  1176.  
  1177. currently = 'Sand plate - V'
  1178.  
  1179. elseif k:lower() == "b" then
  1180.  
  1181. currently = 'Grass Patch - B'
  1182.  
  1183. elseif k:lower() == "x" then
  1184.  
  1185. currently = 'Nothing - X'
  1186.  
  1187. elseif k:lower() == "m" then
  1188.  
  1189. currently = 'Bird - M'
  1190.  
  1191. elseif k:lower() == '0' then
  1192.  
  1193. character.Humanoid.WalkSpeed = 50
  1194.  
  1195. elseif k:lower() == '2' then
  1196.  
  1197. eraser = true
  1198.  
  1199. elseif k:lower() == '1' then
  1200.  
  1201. combo = true
  1202.  
  1203. end
  1204.  
  1205. end)
  1206.  
  1207.  
  1208.  
  1209. mouse.KeyUp:connect(function(k)
  1210.  
  1211. if k:lower() == '0' then
  1212.  
  1213. character.Humanoid.WalkSpeed = 16
  1214.  
  1215. elseif k:lower() == '2' then
  1216.  
  1217. eraser = false
  1218.  
  1219. elseif k:lower() == '1' then
  1220.  
  1221. combo = false
  1222.  
  1223. end
  1224.  
  1225. end)
  1226.  
  1227.  
  1228.  
  1229. mouse.Button1Down:connect(function()
  1230.  
  1231. if model then
  1232.  
  1233. if eraser then
  1234.  
  1235. local ray = Ray.new(camera.CoordinateFrame.p, (mouse.Hit.p - camera.CoordinateFrame.p))
  1236.  
  1237. local hit, pos = workspace:FindPartOnRay(ray, hmm_something_suspicious)
  1238.  
  1239. if hit and hit.Parent == model then
  1240.  
  1241.  
  1242.  
  1243. hit:Destroy()
  1244.  
  1245. elseif hit and hit.Parent.Name == "Tree" then
  1246.  
  1247. hit.Parent:Destroy()
  1248.  
  1249. end
  1250.  
  1251. else
  1252.  
  1253. for index,func in pairs(Props) do
  1254.  
  1255. if index == currently then
  1256.  
  1257. func(plr)
  1258.  
  1259. end
  1260.  
  1261. end
  1262.  
  1263. end
  1264.  
  1265. end
  1266.  
  1267. end)
  1268.  
  1269.  
  1270.  
  1271. local screengui = Instance.new("ScreenGui", plrgui)
  1272.  
  1273. function AddText(text, name)
  1274.  
  1275. local TextLabels = {}
  1276.  
  1277. for i,v in pairs(screengui:children()) do
  1278.  
  1279. if v:IsA'TextLabel' then
  1280.  
  1281. table.insert(TextLabels, v)
  1282.  
  1283. end
  1284.  
  1285. end
  1286.  
  1287.  
  1288.  
  1289. local textl = Instance.new("TextLabel", screengui)
  1290.  
  1291. textl.Text = text
  1292.  
  1293. textl.Size = UDim2.new(.2, 0, 0, 15)
  1294.  
  1295. textl.TextScaled = true
  1296.  
  1297. textl.TextColor3 = Color3.new(1,1,1)
  1298.  
  1299. textl.Position = UDim2.new(.6, 0, 0, #TextLabels*15)
  1300.  
  1301. textl.BackgroundTransparency = .5
  1302.  
  1303. textl.BackgroundColor3 = Color3.new()
  1304.  
  1305. if name then
  1306.  
  1307. textl.Name = name
  1308.  
  1309. end
  1310.  
  1311. end
  1312.  
  1313. for i,v in pairs(Props) do
  1314.  
  1315. AddText(i, i)
  1316.  
  1317. wait()
  1318.  
  1319. end
  1320.  
  1321. AddText('Eraser - Hold CTRL', "Eraser")
  1322.  
  1323. AddText('Persist built - RightCTRL + P')
  1324.  
  1325. AddText('Items are stackable - RightCTRL + L', "StackableGui")
  1326.  
  1327. wait()
  1328.  
  1329. stackablegui = screengui:findFirstChild'StackableGui'
  1330.  
  1331. erase = screengui:findFirstChild'Eraser'
  1332.  
  1333. local currentgui
  1334.  
  1335. while wait() do
  1336.  
  1337. if screengui:findFirstChild(currently) and currentgui then
  1338.  
  1339. if currently == currentgui.Name then
  1340.  
  1341. currentgui.BackgroundColor3 = Color3.new(0,1,0)
  1342.  
  1343. elseif currently ~= currentgui.Name then
  1344.  
  1345. currentgui.BackgroundColor3 = Color3.new()
  1346.  
  1347. end
  1348.  
  1349. end
  1350.  
  1351.  
  1352.  
  1353. if erase then
  1354.  
  1355. if eraser then
  1356.  
  1357. erase.BackgroundColor3 = Color3.new(0,1,0)
  1358.  
  1359. elseif not eraser then
  1360.  
  1361. erase.BackgroundColor3 = Color3.new()
  1362.  
  1363. end
  1364.  
  1365. end
  1366.  
  1367.  
  1368.  
  1369. if stackablegui then
  1370.  
  1371. if stackable then
  1372.  
  1373. stackablegui.BackgroundColor3 = Color3.new(0,1,0)
  1374.  
  1375. elseif not stackable then
  1376.  
  1377. stackablegui.BackgroundColor3 = Color3.new()
  1378.  
  1379. end
  1380.  
  1381. end
  1382.  
  1383. currentgui = screengui:findFirstChild(currently)
  1384.  
  1385. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement