Advertisement
BobMe

BrockS

Oct 18th, 2020 (edited)
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.58 KB | None | 0 0
  1. -- This work is protected under copyright
  2. -- Any attempts to steal and publish this work will be taken action against under law.
  3. --
  4. -- © 2020, Denizen Donut, All rights reserved.
  5.  
  6. wait(2)
  7. fruitmaxcount = 100
  8. local items = {
  9. "Apple",
  10. "Orange",
  11. "Blueberry",
  12. "Cabbage",
  13. "DragonFruit",
  14. "BushsBakedBeans",
  15. "SnowBerry",
  16. "Tier1Sapling",
  17. "Tier2Sapling",
  18. "Tier3Sapling",
  19. "Tier4Sapling",
  20. "Tier5Sapling",
  21. "BrickPoop",
  22. "Fertilizer",
  23. "AppleCompound",
  24. "OrangeCompound",
  25. "BlueberryCompound",
  26. "CabbageCompound",
  27. "DragonFruitCompound",
  28. "Log",
  29. "Stick",
  30. "StandingTorch"
  31. }
  32.  
  33. local dic = {
  34. Apple = {
  35. Name = "Apple",
  36. Description = "The most common and basic food source. It's full of sugar, nutriant, and found everywhere!",
  37. Color = Color3.fromRGB(196, 40, 28),
  38. Size = Vector3.new(0.75, 1, 0.75),
  39. Material = Enum.Material.SmoothPlastic,
  40. Saturation = 25,
  41. Image = "http://www.roblox.com/asset/?id=5841401980"
  42. },
  43. Orange = {
  44. Name = "Orange",
  45. Description = "A less generic food source full of water. Bricks find these to be a very tasty treat!",
  46. Color = Color3.fromRGB(218, 133, 65),
  47. Size = Vector3.new(0.75, 1, 0.75),
  48. Material = Enum.Material.SmoothPlastic,
  49. Saturation = 53,
  50. Image = "http://www.roblox.com/asset/?id=5841402486"
  51. },
  52. Blueberry = {
  53. Name = "Blueberry",
  54. Description = "A thick capsule of sugar that explode with flavor. Bricks find these to look very pretty!",
  55. Color = Color3.fromRGB(13, 105, 172),
  56. Size = Vector3.new(0.75, 1, 0.75),
  57. Material = Enum.Material.SmoothPlastic,
  58. Saturation = 67,
  59. Image = "http://www.roblox.com/asset/?id=5841402851"
  60. },
  61. Cabbage = {
  62. Name = "Cabbage",
  63. Description = "A nutrient rich ball of leaves. Bricks love the crunch, and to them cabbages taste sour and sweet! They sometimes play soccer with these.",
  64. Color = Color3.fromRGB(75, 151, 75),
  65. Size = Vector3.new(0.75, 1, 0.75),
  66. Material = Enum.Material.Slate,
  67. Saturation = 83,
  68. Image = "http://www.roblox.com/asset/?id=5841403181"
  69. },
  70. DragonFruit = {
  71. Name = "Dragon Fruit",
  72. Description = "A cookies and cream fruit with a beautiful pink shell. These are full of nutrience and are especially full of flavor. Bricks tend to fight to the death for these.",
  73. Color = Color3.fromRGB(255, 102, 204),
  74. Size = Vector3.new(0.75, 1, 0.75),
  75. Material = Enum.Material.Sand,
  76. Saturation = 98,
  77. Image = "http://www.roblox.com/asset/?id=5841403563"
  78. },
  79. BushsBakedBeans = {
  80. Name = "Bush's Baked Beans",
  81. Description = "A fruit with a metal shell and strange design. Inside the shell contains many small and squishy capsules that are jam packed with fiber. This might make your brick need to use the restroom.",
  82. Color = Color3.fromRGB(86, 36, 36),
  83. Size = Vector3.new(0.75, 1, 0.75),
  84. Material = Enum.Material.Metal,
  85. Saturation = 113,
  86. Image = "http://www.roblox.com/asset/?id=5841403880"
  87. },
  88. SnowBerry = {
  89. Name = "Snow Berry",
  90. Description = "A berry that isn't very filling, yet full of stimulants. This will excite your brick and make it travel faster!",
  91. Color = Color3.fromRGB(231, 231, 236),
  92. Size = Vector3.new(0.75, 1, 0.75),
  93. Material = Enum.Material.SmoothPlastic,
  94. Saturation = 20,
  95. Image = "http://www.roblox.com/asset/?id=5841404303"
  96. },
  97. Tier1Sapling = {
  98. Name = "Tier 1 Sapling",
  99. Description = "A genetically modified apple sapling which grows many types of fruits, but mostly outputs apples.",
  100. Color = Color3.fromRGB(124, 156, 107),
  101. Size = Vector3.new(0.75, 1.5, 0.75),
  102. Material = Enum.Material.Slate,
  103. Image = "http://www.roblox.com/asset/?id=5842132663"
  104. },
  105. Tier2Sapling = {
  106. Name = "Tier 2 Sapling",
  107. Description = "A genetically modified orange sapling which grows many types of fruits. It mostly grows apples and oranges but sometimes can sprout blueberries.",
  108. Color = Color3.fromRGB(124, 156, 107),
  109. Size = Vector3.new(0.75, 1.5, 0.75),
  110. Material = Enum.Material.Slate,
  111. Image = "http://www.roblox.com/asset/?id=5842132922"
  112. },
  113. Tier3Sapling = {
  114. Name = "Tier 3 Sapling",
  115. Description = "A genetically modified blueberry sapling which grows all types of fruits. This sapling can grow all types of food, but usually grows blueberries and oranges.",
  116. Color = Color3.fromRGB(124, 156, 107),
  117. Size = Vector3.new(0.75, 1.5, 0.75),
  118. Material = Enum.Material.Slate,
  119. Image = "http://www.roblox.com/asset/?id=5842133357"
  120. },
  121. Tier4Sapling = {
  122. Name = "Tier 4 Sapling",
  123. Description = "A genetically modified cabbage sapling which grows all types of fruits. This is a very balanced sapling that grows all food types nearly evenly.",
  124. Color = Color3.fromRGB(124, 156, 107),
  125. Size = Vector3.new(0.75, 1.5, 0.75),
  126. Material = Enum.Material.Slate,
  127. Image = "http://www.roblox.com/asset/?id=5842133570"
  128. },
  129. Tier5Sapling = {
  130. Name = "Tier 5 Sapling",
  131. Description = "A genetically modified cabbage sapling which grows all types of fruits. This is a very rare and exotic sapling which grows mostly exotic fruits.",
  132. Color = Color3.fromRGB(124, 156, 107),
  133. Size = Vector3.new(0.75, 1.5, 0.75),
  134. Material = Enum.Material.Slate,
  135. Image = "http://www.roblox.com/asset/?id=5842133857"
  136. },
  137. BrickPoop = {
  138. Name = "Brick Poop",
  139. Description = "Some smelly and yucky stuff that came out of your brick. Used for fertilizer.",
  140. Color = Color3.fromRGB(106, 57, 9),
  141. Size = Vector3.new(0.75, 0.75, 0.75),
  142. Material = Enum.Material.Granite,
  143. Image = "http://www.roblox.com/asset/?id=5842162205"
  144. },
  145. Fertilizer = {
  146. Name = "Fertilizer",
  147. Description = "Very gross and smelly, but saplings love it.",
  148. Color = Color3.fromRGB(106, 57, 9),
  149. Size = Vector3.new(0.75, 1.75, 0.75),
  150. Material = Enum.Material.Slate,
  151. Image = "http://www.roblox.com/asset/?id=5842171608"
  152. },
  153. AppleCompound = {
  154. Name = "Apple Compound",
  155. Description = "A bunch of apples that have been fused together to create an even bigger more powerful apple! These are very very filling.",
  156. Color = Color3.fromRGB(151, 0, 0),
  157. Size = Vector3.new(1.25, 2, 1.25),
  158. Material = Enum.Material.Slate,
  159. Saturation = 375,
  160. Image = "http://www.roblox.com/asset/?id=5853176500"
  161. },
  162. OrangeCompound = {
  163. Name = "Orange Compound",
  164. Description = "Congradulations! You are now the world record holder of the world's largest orange!",
  165. Color = Color3.fromRGB(170, 85, 0),
  166. Size = Vector3.new(1.25, 2, 1.25),
  167. Material = Enum.Material.Slate,
  168. Saturation = 795,
  169. Image = "http://www.roblox.com/asset/?id=5853176830"
  170. },
  171. BlueberryCompound = {
  172. Name = "Blueberry Compound",
  173. Description = "You could probably just keep this as a bean bag. A very big fleshy bean bag.",
  174. Color = Color3.fromRGB(33, 84, 185),
  175. Size = Vector3.new(1.25, 2, 1.25),
  176. Material = Enum.Material.Slate,
  177. Saturation = 1005,
  178. Image = "http://www.roblox.com/asset/?id=5853177154"
  179. },
  180. CabbageCompound = {
  181. Name = "Cabbage Compound",
  182. Description = "Wow okay now that's ALOT of fiber.",
  183. Color = Color3.fromRGB(44, 101, 29),
  184. Size = Vector3.new(1.25, 2, 1.25),
  185. Material = Enum.Material.Slate,
  186. Saturation = 1245,
  187. Image = "http://www.roblox.com/asset/?id=5853177599"
  188. },
  189. DragonFruitCompound = {
  190. Name = "Dragon Fruit Compound",
  191. Description = "BIG PINK FRUIT YUMMY BIG PINK SUPER NEON BRIGHT YUMMY PINK NO GREEN YUMMY PINK YUM YUM",
  192. Color = Color3.fromRGB(255,0,255),
  193. Size = Vector3.new(1.25, 2, 1.25),
  194. Material = Enum.Material.Slate,
  195. Saturation = 1470,
  196. Image = "http://www.roblox.com/asset/?id=5853178072"
  197. },
  198. Log = {
  199. Name = "Log",
  200. Description = "A fresh log harvested from a fresh tree.",
  201. Color = Color3.fromRGB(105, 63, 40),
  202. Size = Vector3.new(10, 2, 2),
  203. Material = Enum.Material.Wood,
  204. Image = "http://www.roblox.com/asset/?id=6326165327"
  205. },
  206. Stick = {
  207. Name = "Stick",
  208. Description = "A very small log which is used as a handle or for supporting a structure.",
  209. Color = Color3.fromRGB(105, 63, 40),
  210. Size = Vector3.new(5, 1, 1),
  211. Material = Enum.Material.Wood,
  212. Image = "http://www.roblox.com/asset/?id=6326165733"
  213. },
  214. StandingTorch = {
  215. Name = "Standing Torch",
  216. Description = "A super cool torch that you can use to light up super cool things.",
  217. Color = Color3.fromRGB(105, 63, 40),
  218. Size = Vector3.new(2, 4, 2),
  219. Material = Enum.Material.Wood,
  220. Image = "http://www.roblox.com/asset/?id=6326164632"
  221. }
  222. }
  223. local Player = owner
  224. local remote
  225. if Player:FindFirstChild("GrowBrick") == nil then
  226. remote = Instance.new("RemoteEvent",Player)
  227. remote.Name = "GrowBrick"
  228. else
  229. remote = Player:FindFirstChild("GrowBrick")
  230. end
  231. --properties of brick
  232. local brick = Instance.new("Part")
  233. Name = nil
  234. FoodToEat = {}
  235. Size = 1
  236. Hunger = 100
  237. Health = 100
  238. Boredom = 0
  239. Defecation = 0
  240. DefeTick = 20
  241. Position = brick.Position
  242. Rotation = brick.Orientation
  243. Following = false
  244. Wandering = true
  245. LastSafePosition = nil
  246. Moving = false
  247. Tick = 0
  248. Speed = 4
  249. Speede = Speed * Size
  250. MoveRegion = nil
  251. StarvingAlert = false
  252. brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
  253. Instance.new("Folder",script).Name = "Trees-"..Player.Name
  254. local treetier = 0
  255. local R = math.floor(brick.Color.R*255)
  256. local G = math.floor(brick.Color.G*255)
  257. local B = math.floor(brick.Color.B*255)
  258.  
  259. function spawnTree(pos)
  260. local Folder0 = Instance.new("Folder")
  261. local Part1 = Instance.new("Part")
  262. local Part2 = Instance.new("Part")
  263. local Part3 = Instance.new("Part")
  264. local Part4 = Instance.new("Part")
  265. local Part5 = Instance.new("Part")
  266. local Part6 = Instance.new("Part")
  267. local Part7 = Instance.new("Part")
  268. local Part8 = Instance.new("Part")
  269. local Part9 = Instance.new("Part")
  270. local Part10 = Instance.new("Part")
  271. local tier = Instance.new("IntValue")
  272. local tic = Instance.new("IntValue")
  273. tier.Value = treetier
  274. tier.Name = "Tier"
  275. tier.Parent = Folder0
  276. tic.Parent = Folder0
  277. tic.Value = Tick + 25
  278. tic.Name = "Tick"
  279. Folder0.Name = "Tree"
  280. Folder0.Parent = script:FindFirstChild("Trees-"..Player.Name)
  281. Part1.Name = "hitpart"
  282. Part1.Parent = Folder0
  283. Part1.Size = Vector3.new(1, 1, 1)
  284. Part1.Anchored = true
  285. Part1.BottomSurface = Enum.SurfaceType.Smooth
  286. Part1.CanCollide = false
  287. Part1.Locked = true
  288. Part1.Reflectance = 1
  289. Part1.TopSurface = Enum.SurfaceType.Smooth
  290. Part1.Position = pos
  291. Part2.Name = "leaves"
  292. Part2.Parent = Folder0
  293. Part2.Position = Part1.Position + Vector3.new(0, 12, 0)
  294. Part2.Color = Color3.new(0.294118, 0.592157, 0.294118)
  295. Part2.Size = Vector3.new(5, 2, 5)
  296. Part2.Anchored = true
  297. Part2.BottomSurface = Enum.SurfaceType.Smooth
  298. Part2.Locked = true
  299. Part2.Material = Enum.Material.Slate
  300. Part2.TopSurface = Enum.SurfaceType.Smooth
  301. Part3.Name = "trunk"
  302. Part3.Parent = Folder0
  303. Part3.Position = Part1.Position + Vector3.new(0, 3.5, 0)
  304. Part3.Color = Color3.new(0.411765, 0.25098, 0.156863)
  305. Part3.Size = Vector3.new(2, 10, 2)
  306. Part3.Anchored = true
  307. Part3.BottomSurface = Enum.SurfaceType.Smooth
  308. Part3.Locked = true
  309. Part3.Material = Enum.Material.Wood
  310. Part3.TopSurface = Enum.SurfaceType.Smooth
  311. Part4.Name = "leaves"
  312. Part4.Parent = Folder0
  313. Part4.Position = Part1.Position + Vector3.new(0, 9.75, 0)
  314. Part4.Color = Color3.new(0.294118, 0.592157, 0.294118)
  315. Part4.Size = Vector3.new(9, 2.5, 9)
  316. Part4.Anchored = true
  317. Part4.BottomSurface = Enum.SurfaceType.Smooth
  318. Part4.Locked = true
  319. Part4.Material = Enum.Material.Slate
  320. Part4.TopSurface = Enum.SurfaceType.Smooth
  321. Part5.Name = "FruitSpawner1"
  322. Part5.Parent = Folder0
  323. Part5.Position = Part1.Position + Vector3.new(-2.5, 8.25, -2.5)
  324. Part5.Color = Color3.new(0.294118, 0.592157, 0.294118)
  325. Part5.Transparency = 1
  326. Part5.Size = Vector3.new(1, 0.5, 1)
  327. Part5.Anchored = true
  328. Part5.BottomSurface = Enum.SurfaceType.Smooth
  329. Part5.Locked = true
  330. Part5.Material = Enum.Material.Slate
  331. Part5.TopSurface = Enum.SurfaceType.Smooth
  332. Part5.CanCollide = false
  333. Part6.Name = "FruitSpawner2"
  334. Part6.Parent = Folder0
  335. Part6.Position = Part1.Position + Vector3.new(2.5, 8.25, -2.5)
  336. Part6.Color = Color3.new(0.294118, 0.592157, 0.294118)
  337. Part6.Transparency = 1
  338. Part6.Size = Vector3.new(1, 0.5, 1)
  339. Part6.Anchored = true
  340. Part6.BottomSurface = Enum.SurfaceType.Smooth
  341. Part6.Locked = true
  342. Part6.Material = Enum.Material.Slate
  343. Part6.TopSurface = Enum.SurfaceType.Smooth
  344. Part6.CanCollide = false
  345. Part7.Name = "FruitSpawner3"
  346. Part7.CanCollide = false
  347. Part7.Parent = Folder0
  348. Part7.Position = Part1.Position + Vector3.new(4, 8.25, 0.5)
  349. Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
  350. Part7.Transparency = 1
  351. Part7.Size = Vector3.new(1, 0.5, 1)
  352. Part7.Anchored = true
  353. Part7.BottomSurface = Enum.SurfaceType.Smooth
  354. Part7.Locked = true
  355. Part7.Material = Enum.Material.Slate
  356. Part7.TopSurface = Enum.SurfaceType.Smooth
  357. Part8.Name = "FruitSpawner4"
  358. Part8.Parent = Folder0
  359. Part8.Position = Part1.Position + Vector3.new(3.5, 8.25, 3)
  360. Part8.Color = Color3.new(0.294118, 0.592157, 0.294118)
  361. Part8.Transparency = 1
  362. Part8.Size = Vector3.new(1, 0.5, 1)
  363. Part8.Anchored = true
  364. Part8.BottomSurface = Enum.SurfaceType.Smooth
  365. Part8.Locked = true
  366. Part8.Material = Enum.Material.Slate
  367. Part8.TopSurface = Enum.SurfaceType.Smooth
  368. Part8.CanCollide = false
  369. Part9.Name = "FruitSpawner5"
  370. Part9.Parent = Folder0
  371. Part9.Position = Part1.Position + Vector3.new(-1, 8.25, 3)
  372. Part9.Color = Color3.new(0.294118, 0.592157, 0.294118)
  373. Part9.Transparency = 1
  374. Part9.Size = Vector3.new(1, 0.5, 1)
  375. Part9.Anchored = true
  376. Part9.BottomSurface = Enum.SurfaceType.Smooth
  377. Part9.Locked = true
  378. Part9.Material = Enum.Material.Slate
  379. Part9.TopSurface = Enum.SurfaceType.Smooth
  380. Part9.CanCollide = false
  381. Part10.Name = "FruitSpawner6"
  382. Part10.Parent = Folder0
  383. Part10.Position = Part1.Position + Vector3.new(-3.5, 8.25, 0)
  384. Part10.Color = Color3.new(0.294118, 0.592157, 0.294118)
  385. Part10.Transparency = 1
  386. Part10.Size = Vector3.new(1, 0.5, 1)
  387. Part10.Anchored = true
  388. Part10.BottomSurface = Enum.SurfaceType.Smooth
  389. Part10.Locked = true
  390. Part10.Material = Enum.Material.Slate
  391. Part10.TopSurface = Enum.SurfaceType.Smooth
  392. Part10.CanCollide = false
  393. return Folder0
  394. end
  395. local bap = 0
  396. function playSound(id,volume,pitch,parent,namer,timer)
  397. if id ~= nil and volume ~= nil and pitch ~= nil and parent ~= nil and namer ~= nil then
  398. bap = bap + 1
  399. local oldbap = bap
  400. local sound = parent:FindFirstChild(namer)
  401. if sound == nil then
  402. sound = Instance.new("Sound",parent)
  403. end
  404. if sound ~= nil and sound.Parent ~= nil then
  405. sound.Volume = volume
  406. sound.SoundId = "rbxassetid://"..tostring(id)
  407. sound.Pitch = pitch
  408. sound.Name = namer
  409. sound:Play()
  410. if timer ~= nil then
  411. coroutine.resume(coroutine.create(function()
  412. wait(timer)
  413. if bap == oldbap then
  414. sound:Stop()
  415. end
  416. end))
  417. end
  418. end
  419. end
  420. end
  421. function spawnTorch(pos,mas)
  422. local Model0 = Instance.new("Model")
  423. local Part1 = Instance.new("Part")
  424. local Part2 = Instance.new("Part")
  425. local Part3 = Instance.new("Part")
  426. local Part4 = Instance.new("Part")
  427. local Part5 = Instance.new("Part")
  428. local Part6 = Instance.new("Part")
  429. local Part7 = Instance.new("Part")
  430. local Part8 = Instance.new("Part")
  431. local Part9 = Instance.new("Part")
  432. local Part10 = Instance.new("Part")
  433. local Part11 = Instance.new("Part")
  434. local Part12 = Instance.new("Part")
  435. local Part13 = Instance.new("Part")
  436. local Part14 = Instance.new("Part")
  437. local Fire15 = Instance.new("Fire")
  438. local Part16 = Instance.new("Part")
  439. local PointLight17 = Instance.new("PointLight")
  440. local Part19 = Instance.new("Part")
  441. Model0.Name = "Standing Torch"
  442. Model0.Parent = mas
  443. Model0.PrimaryPart = Part12
  444. Part1.Name = "Tripod"
  445. Part1.Parent = Model0
  446. Part1.Orientation = Vector3.new(30, 0, 0)
  447. Part1.Position = Vector3.new(-0.000365999993, 1.37948096, -0.730346978)
  448. Part1.Color = Color3.new(0.411765, 0.25098, 0.156863)
  449. Part1.Size = Vector3.new(0.5, 2.75, 0.5)
  450. Part1.Anchored = true
  451. Part1.Locked = true
  452. Part1.Material = Enum.Material.Wood
  453. Part2.Name = "Tripod"
  454. Part2.Parent = Model0
  455. Part2.Orientation = Vector3.new(30, 120, 0)
  456. Part2.Position = Vector3.new(-0.565231025, 1.38970196, 0.326691002)
  457. Part2.Color = Color3.new(0.411765, 0.25098, 0.156863)
  458. Part2.Size = Vector3.new(0.5, 2.75, 0.5)
  459. Part2.Anchored = true
  460. Part2.Locked = true
  461. Part2.Material = Enum.Material.Wood
  462. Part3.Name = "Tripod"
  463. Part3.Parent = Model0
  464. Part3.Orientation = Vector3.new(30, -120, 0)
  465. Part3.Position = Vector3.new(0.642310977, 1.31578696, 0.313324004)
  466. Part3.Color = Color3.new(0.411765, 0.25098, 0.156863)
  467. Part3.Size = Vector3.new(0.5, 2.75, 0.5)
  468. Part3.Anchored = true
  469. Part3.Locked = true
  470. Part3.Material = Enum.Material.Wood
  471. Part4.Name = "Cage"
  472. Part4.Parent = Model0
  473. Part4.Orientation = Vector3.new(15, -90, 0)
  474. Part4.Position = Vector3.new(0.366115987, 5.36940813, -0.000335999997)
  475. Part4.Color = Color3.new(0.8, 0.556863, 0.411765)
  476. Part4.Size = Vector3.new(0.125, 1.75, 0.125)
  477. Part4.Anchored = true
  478. Part4.Locked = true
  479. Part4.Material = Enum.Material.Slate
  480. Part5.Name = "Cage"
  481. Part5.Parent = Model0
  482. Part5.Orientation = Vector3.new(-15, -90, 0)
  483. Part5.Position = Vector3.new(-0.383884013, 5.36940813, -0.000335999997)
  484. Part5.Color = Color3.new(0.8, 0.556863, 0.411765)
  485. Part5.Size = Vector3.new(0.125, 1.75, 0.125)
  486. Part5.Anchored = true
  487. Part5.Locked = true
  488. Part5.Material = Enum.Material.Slate
  489. Part6.Name = "Cage"
  490. Part6.Parent = Model0
  491. Part6.Orientation = Vector3.new(-15, -135, 0)
  492. Part6.Position = Vector3.new(-0.274048001, 5.36940813, -0.265502989)
  493. Part6.Color = Color3.new(0.8, 0.556863, 0.411765)
  494. Part6.Size = Vector3.new(0.125, 1.75, 0.125)
  495. Part6.Anchored = true
  496. Part6.Locked = true
  497. Part6.Material = Enum.Material.Slate
  498. Part7.Name = "Cage"
  499. Part7.Parent = Model0
  500. Part7.Orientation = Vector3.new(15, -135, 0)
  501. Part7.Position = Vector3.new(0.256278992, 5.36940813, 0.26483199)
  502. Part7.Color = Color3.new(0.8, 0.556863, 0.411765)
  503. Part7.Size = Vector3.new(0.125, 1.75, 0.125)
  504. Part7.Anchored = true
  505. Part7.Locked = true
  506. Part7.Material = Enum.Material.Slate
  507. Part8.Name = "Cage"
  508. Part8.Parent = Model0
  509. Part8.Orientation = Vector3.new(-15, 180, 0)
  510. Part8.Position = Vector3.new(-0.00888399966, 5.36940813, -0.375319988)
  511. Part8.Color = Color3.new(0.8, 0.556863, 0.411765)
  512. Part8.Size = Vector3.new(0.125, 1.75, 0.125)
  513. Part8.Anchored = true
  514. Part8.Locked = true
  515. Part8.Material = Enum.Material.Slate
  516. Part9.Name = "Cage"
  517. Part9.Parent = Model0
  518. Part9.Orientation = Vector3.new(15, 180, 0)
  519. Part9.Position = Vector3.new(-0.00888399966, 5.36940813, 0.374680012)
  520. Part9.Color = Color3.new(0.8, 0.556863, 0.411765)
  521. Part9.Size = Vector3.new(0.125, 1.75, 0.125)
  522. Part9.Anchored = true
  523. Part9.Locked = true
  524. Part9.Material = Enum.Material.Slate
  525. Part10.Name = "Cage"
  526. Part10.Parent = Model0
  527. Part10.Orientation = Vector3.new(-15, 135, 0)
  528. Part10.Position = Vector3.new(0.271872997, 5.36940813, -0.259032995)
  529. Part10.Color = Color3.new(0.8, 0.556863, 0.411765)
  530. Part10.Size = Vector3.new(0.125, 1.75, 0.125)
  531. Part10.Anchored = true
  532. Part10.Locked = true
  533. Part10.Material = Enum.Material.Slate
  534. Part11.Name = "Cage"
  535. Part11.Parent = Model0
  536. Part11.Orientation = Vector3.new(15, 135, 0)
  537. Part11.Position = Vector3.new(-0.258450001, 5.36940813, 0.271286011)
  538. Part11.Color = Color3.new(0.8, 0.556863, 0.411765)
  539. Part11.Size = Vector3.new(0.125, 1.75, 0.125)
  540. Part11.Anchored = true
  541. Part11.Locked = true
  542. Part11.Material = Enum.Material.Slate
  543. Part12.Name = "HitPart"
  544. Part12.Parent = Model0
  545. Part12.Position = Vector3.new(0, 0.378405005, 0)
  546. Part12.Color = Color3.new(0.411765, 0.25098, 0.156863)
  547. Part12.Transparency = 1
  548. Part12.Size = Vector3.new(0.5, 0.5, 0.5)
  549. Part12.Anchored = true
  550. Part12.CanCollide = false
  551. Part12.Locked = true
  552. Part12.Material = Enum.Material.Wood
  553. Part13.Name = "Base"
  554. Part13.Parent = Model0
  555. Part13.Position = Vector3.new(-0.000365999993, 4.55469084, -0.000335999997)
  556. Part13.Color = Color3.new(0.411765, 0.25098, 0.156863)
  557. Part13.Size = Vector3.new(1, 0.25, 1)
  558. Part13.Anchored = true
  559. Part13.Locked = true
  560. Part13.Material = Enum.Material.Wood
  561. Part14.Name = "Coal"
  562. Part14.Parent = Model0
  563. Part14.Position = Vector3.new(-0.000365999993, 4.86718607, -0.000335999997)
  564. Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
  565. Part14.Size = Vector3.new(0.5, 0.375, 0.5)
  566. Part14.Anchored = true
  567. Part14.Locked = true
  568. Part14.Material = Enum.Material.Slate
  569. Fire15.Parent = Part14
  570. Fire15.Size = 2
  571. Part16.Name = "light"
  572. Part16.Parent = Model0
  573. Part16.Position = Vector3.new(-0.000365999993, 6.86718988, -0.000335999997)
  574. Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
  575. Part16.Transparency = 1
  576. Part16.Size = Vector3.new(0.5, 0.375, 0.5)
  577. Part16.Anchored = true
  578. Part16.CanCollide = false
  579. Part16.Locked = true
  580. Part16.Material = Enum.Material.Slate
  581. PointLight17.Parent = Part16
  582. PointLight17.Color = Color3.new(1, 0.717647, 0)
  583. PointLight17.Range = 60
  584. PointLight17.Shadows = true
  585. Part19.Name = "Baser"
  586. Part19.Parent = Model0
  587. Part19.Position = Vector3.new(-0.000365999993, 3.17971802, -0.000335999997)
  588. Part19.Color = Color3.new(0.411765, 0.25098, 0.156863)
  589. Part19.Size = Vector3.new(0.5, 2.5, 0.5)
  590. Part19.Anchored = true
  591. Part19.Locked = true
  592. Part19.Material = Enum.Material.Wood
  593. Model0:MoveTo(pos)
  594. return Model0
  595. end
  596.  
  597. remote.OnServerEvent:Connect(function(plr,mode,data)
  598. if mode == "Begin" then
  599. Name = data
  600. remote:FireClient(plr,script)
  601. elseif mode == "Drop" then
  602. local item = dic[items[data]]
  603. local dat = data
  604. local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
  605. part.Material = item.Material
  606. part.Color = item.Color
  607. part.Size = item.Size
  608. part.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,1.5,-3)
  609. local click = Instance.new("ClickDetector",part)
  610. local int = Instance.new("IntValue",part)
  611. int.Name = "Type"
  612. int.Value = dat
  613. local pla
  614. click.MouseClick:Connect(function(plr)
  615. pla = plr
  616. if plr:FindFirstChild("GrowBrick") ~= nil then
  617. plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",int.Value)
  618. part:Destroy()
  619. if plr == Player then
  620. playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
  621. end
  622. end
  623. end)
  624. elseif mode == "Use" then
  625. local item = dic[items[data[1]]]
  626. local dat = data[1]
  627. local pos = data[2]
  628. local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
  629. part.Material = item.Material
  630. part.Color = item.Color
  631. part.Size = item.Size
  632. part.Position = pos
  633. playSound(5035412139,1,3,Player.Character.Head,"Ding")
  634. local int = Instance.new("IntValue",part)
  635. int.Name = "Type"
  636. int.Value = dat
  637. local click = Instance.new("ClickDetector",part)
  638. table.insert(FoodToEat,part)
  639. local pla
  640. click.MouseClick:Connect(function(plr)
  641. pla = plr
  642. if plr:FindFirstChild("GrowBrick") ~= nil and plr == Player then
  643. plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",int.Value)
  644. part:Destroy()
  645. if plr == Player then
  646. playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
  647. end
  648. end
  649. end)
  650. elseif mode == "Tree" then
  651. treetier = data[2]
  652. spawnTree(data[1])
  653. playSound(4676738150,1,1.5,Player.Character.Head,"Pop")
  654. elseif mode == "Whistle" then
  655. playSound(2286309043,1,2.5,Player.Character.Head,"Whistle")
  656. Boredom = 0
  657. --Following = true
  658. elseif mode == "Craft" then
  659. playSound(866697902,1,1,Player.Character.Head,"Craft1")
  660. playSound(3433989587,1,1.25,Player.Character.Head,"Craft2",1.93)
  661. elseif mode == "Demolish" then
  662. if data.Parent.Parent.Name == "Trees-"..Player.Name then
  663. data.Parent:Destroy()
  664. playSound(4056786383,1,1,Player.Character.Head,"Grab")
  665. end
  666. elseif mode == "Torch" then
  667. playSound(4676738150,1,1.5,Player.Character.Head,"Pop")
  668. local mod = spawnTorch(data,script:FindFirstChild("Trees-"..Player.Name))
  669. coroutine.resume(coroutine.create(function()
  670. while wait(.1) do
  671. if mod ~= nil and mod.Parent ~= nil then
  672. local light = mod.light.PointLight
  673. local mth = math.random(550,600)/10
  674. light.Range = mth
  675. else
  676. break
  677. end
  678. end
  679. end))
  680. elseif mode == "Quit" then
  681. brick:Destroy()
  682. script:FindFirstChild("Trees-"..Player.Name)
  683. script:Destroy()
  684. end
  685. end)
  686.  
  687. repeat wait(1) until Name ~= nil
  688. local TweenService = game:GetService("TweenService")
  689. brick.Name = "Brick"..Player.Name
  690. brick.Parent = workspace
  691. brick.Size = Vector3.new(0.5,0.25,0.5)
  692. brick.Position = Player.Character.Head.Position - Vector3.new(-2,4,0)
  693. --[[local bodyGyro = Instance.new("BodyGyro",brick)
  694. bodyGyro.MaxTorque = Vector3.new(400000,0,400000)
  695. bodyGyro.CFrame = brick.CFrame
  696. bodyGyro.D = 1250
  697. bodyGyro.P = 3000]]
  698. -- Instances:
  699. local BillboardGui
  700. local Frame
  701. local namer
  702. local hunger
  703. local health
  704. local bar
  705. local FoodBackground
  706. local FoodBar
  707.  
  708. function findPlayer(name)
  709. return game.Players:FindFirstChild(name)
  710. end
  711.  
  712. function gui()
  713. BillboardGui = Instance.new("BillboardGui")
  714. Frame = Instance.new("Frame")
  715. namer = Instance.new("TextBox")
  716. hunger = Instance.new("TextBox")
  717. health = Instance.new("TextBox")
  718. bar = Instance.new("TextBox")
  719. FoodBackground = Instance.new("Frame")
  720. FoodBar = Instance.new("Frame")
  721.  
  722. --Properties:
  723.  
  724. BillboardGui.Parent = brick
  725. BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  726. BillboardGui.Active = true
  727. BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
  728. BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
  729.  
  730. Frame.Parent = BillboardGui
  731. Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  732. Frame.BackgroundTransparency = 1.000
  733. Frame.Size = UDim2.new(1, 0, 0.800000012, 0)
  734.  
  735. namer.Name = "namer"
  736. namer.Parent = Frame
  737. namer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  738. namer.BackgroundTransparency = 1.000
  739. namer.Size = UDim2.new(1, 0, 0.649999976, 0)
  740. namer.Font = Enum.Font.GothamSemibold
  741. namer.Text = "Brick"
  742. namer.TextColor3 = Color3.fromRGB(255, 255, 255)
  743. namer.TextScaled = true
  744. namer.TextSize = 14.000
  745. namer.TextWrapped = true
  746. namer.TextYAlignment = Enum.TextYAlignment.Bottom
  747.  
  748. hunger.Name = "hunger"
  749. hunger.Parent = Frame
  750. hunger.BackgroundColor3 = Color3.fromRGB(255, 119, 0)
  751. hunger.BackgroundTransparency = 1.000
  752. hunger.Position = UDim2.new(0, 0, 0.699999988, 0)
  753. hunger.Size = UDim2.new(0.5, 0, 0.300000012, 0)
  754. hunger.Font = Enum.Font.GothamSemibold
  755. hunger.Text = "🍗 0"
  756. hunger.TextColor3 = Color3.fromRGB(255, 128, 0)
  757. hunger.TextScaled = true
  758. hunger.TextSize = 14.000
  759. hunger.TextWrapped = true
  760. hunger.TextXAlignment = Enum.TextXAlignment.Right
  761. hunger.TextYAlignment = Enum.TextYAlignment.Top
  762.  
  763. health.Name = "health"
  764. health.Parent = Frame
  765. health.AnchorPoint = Vector2.new(1, 0)
  766. health.BackgroundColor3 = Color3.fromRGB(255, 119, 0)
  767. health.BackgroundTransparency = 1.000
  768. health.Position = UDim2.new(1, 0, 0.699999988, 0)
  769. health.Size = UDim2.new(0.5, 0, 0.300000012, 0)
  770. health.Font = Enum.Font.GothamSemibold
  771. health.Text = "💕0"
  772. health.TextColor3 = Color3.fromRGB(255, 0, 0)
  773. health.TextScaled = true
  774. health.TextSize = 14.000
  775. health.TextWrapped = true
  776. health.TextXAlignment = Enum.TextXAlignment.Left
  777. health.TextYAlignment = Enum.TextYAlignment.Top
  778.  
  779. bar.Name = "bar"
  780. bar.Parent = Frame
  781. bar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  782. bar.BorderSizePixel = 0
  783. bar.Position = UDim2.new(0, 0, 0.649999976, 0)
  784. bar.Size = UDim2.new(1, 0, 0.0250000004, 0)
  785. bar.Font = Enum.Font.Nunito
  786. bar.Text = ""
  787. bar.TextColor3 = Color3.fromRGB(255, 255, 255)
  788. bar.TextScaled = true
  789. bar.TextSize = 14.000
  790. bar.TextWrapped = true
  791. bar.TextYAlignment = Enum.TextYAlignment.Bottom
  792.  
  793. FoodBackground.Name = "FoodBackground"
  794. FoodBackground.Parent = BillboardGui
  795. FoodBackground.AnchorPoint = Vector2.new(0, 1)
  796. FoodBackground.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  797. FoodBackground.BackgroundTransparency = 1
  798. FoodBackground.BorderSizePixel = 0
  799. FoodBackground.Position = UDim2.new(0, 0, 1, 0)
  800. FoodBackground.Size = UDim2.new(1, 0, 0.200000003, 0)
  801.  
  802. FoodBar.Name = "FoodBar"
  803. FoodBar.Parent = FoodBackground
  804. FoodBar.AnchorPoint = Vector2.new(0, 1)
  805. FoodBar.BackgroundColor3 = Color3.fromRGB(255, 128, 0)
  806. FoodBar.BackgroundTransparency = 1
  807. FoodBar.BorderSizePixel = 0
  808. FoodBar.Position = UDim2.new(0, 0, 1, 0)
  809. FoodBar.Size = UDim2.new(0.5, 0, 1, 0)
  810. end
  811.  
  812. -- Brick Movement Script
  813. local function moveTo(pos)
  814. if Moving then repeat wait() until not Moving end
  815. local p = Instance.new("MeshPart")
  816. p.Transparency = 1
  817. p.CanCollide = false
  818. p.Anchored = true
  819. p.CFrame = CFrame.new(brick.Position,pos)
  820. local goal = {}
  821. goal.Orientation = p.Orientation
  822. local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
  823. tween:Play()
  824. wait(0.5)
  825. local mag = (brick.Position - pos).Magnitude
  826. local sped = 0.2*Speede
  827. local waittime = mag/sped
  828. local goal2 = {}
  829. goal2.Position = Vector3.new(pos.X,pos.Y+brick.Size.Y/2,pos.Z)
  830. local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
  831. Moving = true
  832. tween:Play()
  833. Moving = false
  834. return waittime
  835. end
  836. local function moveForwards(pos)
  837. --if Moving then repeat wait() until not Moving end
  838. local p = Instance.new("MeshPart")
  839. p.Transparency = 1
  840. p.CanCollide = false
  841. p.Anchored = true
  842. p.CFrame = CFrame.new(brick.Position,pos)
  843. local goal = {}
  844. goal.Orientation = p.Orientation
  845. local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
  846. tween:Play()
  847. wait(0)
  848. local mag = (brick.Position - pos).Magnitude
  849. local sped = (0.2*Speede)/8
  850. local waittime = 0.125
  851. local goal2 = {}
  852. goal2.Position = (brick.CFrame * CFrame.new(0,0,-sped)).p
  853. local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
  854. Moving = true
  855. tween:Play()
  856. Moving = false
  857. return waittime
  858. end
  859.  
  860. if true then
  861. Player.Chatted:Connect(function(msg)
  862. if string.lower(msg) == ";clrtrees" then
  863. if script:FindFirstChild("Trees-"..Player.Name) ~= nil then
  864. for i,v in pairs(script:FindFirstChild("Trees-"..Player.Name):GetChildren()) do
  865. if v.ClassName == "Folder" then
  866. v:Destroy()
  867. end
  868. end
  869. end
  870. elseif string.lower(string.sub(msg,1,9)) == ";setsize " then
  871. Size = tonumber(string.sub(msg,10))
  872. local rayorigin2 = brick.Position
  873. local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  874. local raycastParams = RaycastParams.new()
  875. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  876. raycastParams.FilterDescendantsInstances = {brick}
  877. local ray = workspace:Raycast(
  878. rayorigin2,
  879. raydirection2,
  880. raycastParams
  881. )
  882. BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
  883. BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
  884. if brick ~= nil and brick.Parent ~= nil and brick.Size ~= nil and brick.Position ~= nil then
  885. brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
  886. if brick ~= nil and brick.Parent ~= nil and brick.Size ~= nil and brick.Position ~= nil then
  887. brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
  888. end
  889. end
  890. Speede = Speed * Size
  891. elseif string.lower(string.sub(msg,1,10)) == ";setspeed " then
  892. Speed = tonumber(string.sub(msg,11))
  893. Speede = Speed * Size
  894. elseif string.lower(string.sub(msg,1,11)) == ";sethealth " then
  895. local am = tonumber(string.sub(msg,12))
  896. Health = am
  897. hunger.Text = "🍗 "..tostring(Hunger)
  898. health.Text = "💕"..tostring(Health)
  899. elseif string.lower(string.sub(msg,1,11)) == ";sethunger " then
  900. local am = tonumber(string.sub(msg,12))
  901. Hunger = am
  902. hunger.Text = "🍗 "..tostring(Hunger)
  903. health.Text = "💕"..tostring(Health)
  904. end
  905. end)
  906. end
  907.  
  908. repeat wait() until Name ~= nil
  909. gui()
  910. hunger.Text = "🍗 "..tostring(Hunger)
  911. health.Text = "💕"..tostring(Health)
  912. namer.Text = Name
  913. --food and health
  914. local fruitcount = 0
  915. coroutine.resume(coroutine.create(function()
  916. while wait(1) do
  917. Tick = Tick + 1
  918. if DefeTick <= Tick then
  919. Defecation = Defecation + 1
  920. DefeTick = Tick + 20
  921. end
  922. if brick == nil or brick.Parent == nil then
  923. brick = Instance.new("Part")
  924. brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
  925. brick.Name = "Brick"..Player.Name
  926. brick.Parent = workspace
  927. brick.Position = LastSafePosition
  928. brick.Color = Color3.fromRGB(R,G,B)
  929. gui()
  930. hunger.Text = "🍗 "..tostring(Hunger)
  931. health.Text = "💕"..tostring(Health)
  932. namer.Text = Name
  933. end
  934. if Defecation >= 2 then
  935. Defecation = 0
  936. local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
  937. playSound(357613509,1,1,brick,"Fart")
  938. part.Size = dic.BrickPoop.Size
  939. part.CFrame = brick.CFrame * CFrame.new(0,0,brick.Size.X-(part.Size.X/2))
  940. part.Color = dic.BrickPoop.Color
  941. part.Material = dic.BrickPoop.Material
  942. local int = Instance.new("IntValue",part)
  943. int.Name = "Type"
  944. int.Value = 13
  945. local click = Instance.new("ClickDetector",part)
  946. click.MouseClick:Connect(function(plr)
  947. if plr:FindFirstChild("GrowBrick") ~= nil then
  948. plr:FindFirstChild("GrowBrick"):FireClient(plr,"Pickup",13)
  949. playSound(4056786383,1,1.6,plr.Character.Head,"Grab")
  950. part:Destroy()
  951. end
  952. end)
  953. end
  954. remote:FireClient(Player,"Stats",{Hunger,Health,Boredom,Defecation,Speed,Size,Following,Wandering,Tick,DefeTick,brick.Color})
  955. if script:FindFirstChild("Trees-"..Player.Name) ~= nil then
  956. for i,v in pairs(script:FindFirstChild("Trees-"..Player.Name):GetChildren()) do
  957. if v.ClassName == "Folder" then
  958. local tic = v:FindFirstChild("Tick")
  959. if tic.Value <= Tick then
  960. tic.Value = Tick + 25
  961. if fruitcount < fruitmaxcount then
  962. local maf = math.random(1,6)
  963. local fs = v:FindFirstChild("FruitSpawner"..tostring(maf))
  964. local tier = v:FindFirstChild("Tier").Value
  965. local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
  966. local data = 0
  967. if tier == 1 then
  968. local maf = math.random(1,100)
  969. if maf >= 1 and maf <= 70 then
  970. local item = dic.Apple
  971. part.Size = item.Size
  972. part.Color = item.Color
  973. part.Material = item.Material
  974. data = 1
  975. elseif maf >= 71 and maf <= 90 then
  976. local item = dic.Orange
  977. part.Size = item.Size
  978. part.Color = item.Color
  979. part.Material = item.Material
  980. data = 2
  981. elseif maf >= 91 and maf <= 94 then
  982. local item = dic.Blueberry
  983. part.Size = item.Size
  984. part.Color = item.Color
  985. part.Material = item.Material
  986. data = 3
  987. elseif maf >= 95 and maf <= 97 then
  988. local item = dic.Cabbage
  989. part.Size = item.Size
  990. part.Color = item.Color
  991. data = 4
  992. part.Material = item.Material
  993. elseif maf >= 98 and maf <= 99 then
  994. local item = dic.DragonFruit
  995. part.Size = item.Size
  996. part.Color = item.Color
  997. part.Material = item.Material
  998. data = 5
  999. elseif maf >= 100 and maf <= 100 then
  1000. local item = dic.BushsBakedBeans
  1001. part.Size = item.Size
  1002. part.Color = item.Color
  1003. part.Material = item.Material
  1004. data = 6
  1005. end
  1006. elseif tier == 2 then
  1007. local maf = math.random(1,100)
  1008. if maf >= 1 and maf <= 40 then
  1009. local item = dic.Apple
  1010. part.Size = item.Size
  1011. part.Color = item.Color
  1012. part.Material = item.Material
  1013. data = 1
  1014. elseif maf >= 41 and maf <= 80 then
  1015. local item = dic.Orange
  1016. part.Size = item.Size
  1017. part.Color = item.Color
  1018. part.Material = item.Material
  1019. data = 2
  1020. elseif maf >= 81 and maf <= 93 then
  1021. local item = dic.Blueberry
  1022. part.Size = item.Size
  1023. part.Color = item.Color
  1024. part.Material = item.Material
  1025. data = 3
  1026. elseif maf >= 94 and maf <= 97 then
  1027. local item = dic.Cabbage
  1028. part.Size = item.Size
  1029. part.Color = item.Color
  1030. part.Material = item.Material
  1031. data = 4
  1032. elseif maf >= 98 and maf <= 99 then
  1033. local item = dic.DragonFruit
  1034. part.Size = item.Size
  1035. part.Color = item.Color
  1036. part.Material = item.Material
  1037. data = 5
  1038. elseif maf >= 100 and maf <= 100 then
  1039. local item = dic.BushsBakedBeans
  1040. part.Size = item.Size
  1041. part.Color = item.Color
  1042. part.Material = item.Material
  1043. data = 6
  1044. end
  1045. elseif tier == 3 then
  1046. local maf = math.random(1,100)
  1047. if maf >= 1 and maf <= 15 then
  1048. local item = dic.Apple
  1049. part.Size = item.Size
  1050. part.Color = item.Color
  1051. part.Material = item.Material
  1052. data = 1
  1053. elseif maf >= 16 and maf <= 40 then
  1054. local item = dic.Orange
  1055. part.Size = item.Size
  1056. part.Color = item.Color
  1057. part.Material = item.Material
  1058. data = 2
  1059. elseif maf >= 41 and maf <= 80 then
  1060. local item = dic.Blueberry
  1061. part.Size = item.Size
  1062. part.Color = item.Color
  1063. part.Material = item.Material
  1064. data = 3
  1065. elseif maf >= 81 and maf <= 90 then
  1066. local item = dic.Cabbage
  1067. part.Size = item.Size
  1068. part.Color = item.Color
  1069. part.Material = item.Material
  1070. data = 4
  1071. elseif maf >= 91 and maf <= 95 then
  1072. local item = dic.DragonFruit
  1073. part.Size = item.Size
  1074. part.Color = item.Color
  1075. part.Material = item.Material
  1076. data = 5
  1077. elseif maf >= 96 and maf <= 98 then
  1078. local item = dic.BushsBakedBeans
  1079. part.Size = item.Size
  1080. part.Color = item.Color
  1081. part.Material = item.Material
  1082. data = 6
  1083. elseif maf >= 99 and maf <= 100 then
  1084. local item = dic.SnowBerry
  1085. part.Size = item.Size
  1086. part.Color = item.Color
  1087. part.Material = item.Material
  1088. data = 7
  1089. end
  1090. elseif tier == 4 then
  1091. local maf = math.random(1,100)
  1092. if maf >= 1 and maf <= 10 then
  1093. local item = dic.Apple
  1094. part.Size = item.Size
  1095. part.Color = item.Color
  1096. part.Material = item.Material
  1097. data = 1
  1098. elseif maf >= 11 and maf <= 20 then
  1099. local item = dic.Orange
  1100. part.Size = item.Size
  1101. part.Color = item.Color
  1102. part.Material = item.Material
  1103. data = 2
  1104. elseif maf >= 21 and maf <= 40 then
  1105. local item = dic.Blueberry
  1106. part.Size = item.Size
  1107. part.Color = item.Color
  1108. part.Material = item.Material
  1109. data = 3
  1110. elseif maf >= 41 and maf <= 80 then
  1111. local item = dic.Cabbage
  1112. part.Size = item.Size
  1113. part.Color = item.Color
  1114. part.Material = item.Material
  1115. data = 4
  1116. elseif maf >= 81 and maf <= 90 then
  1117. local item = dic.DragonFruit
  1118. part.Size = item.Size
  1119. part.Color = item.Color
  1120. part.Material = item.Material
  1121. data = 5
  1122. elseif maf >= 91 and maf <= 95 then
  1123. local item = dic.BushsBakedBeans
  1124. part.Size = item.Size
  1125. part.Color = item.Color
  1126. part.Material = item.Material
  1127. data = 6
  1128. elseif maf >= 96 and maf <= 100 then
  1129. local item = dic.SnowBerry
  1130. part.Size = item.Size
  1131. part.Color = item.Color
  1132. part.Material = item.Material
  1133. data = 7
  1134. end
  1135. elseif tier == 5 then
  1136. local maf = math.random(1,100)
  1137. if maf >= 1 and maf <= 3 then
  1138. local item = dic.Apple
  1139. part.Size = item.Size
  1140. part.Color = item.Color
  1141. part.Material = item.Material
  1142. data = 1
  1143. elseif maf >= 4 and maf <= 6 then
  1144. local item = dic.Orange
  1145. part.Size = item.Size
  1146. part.Color = item.Color
  1147. part.Material = item.Material
  1148. data = 2
  1149. elseif maf >= 7 and maf <= 14 then
  1150. local item = dic.Blueberry
  1151. part.Size = item.Size
  1152. part.Color = item.Color
  1153. part.Material = item.Material
  1154. data = 3
  1155. elseif maf >= 15 and maf <= 40 then
  1156. local item = dic.Cabbage
  1157. part.Size = item.Size
  1158. part.Color = item.Color
  1159. part.Material = item.Material
  1160. data = 4
  1161. elseif maf >= 41 and maf <= 75 then
  1162. local item = dic.DragonFruit
  1163. part.Size = item.Size
  1164. part.Color = item.Color
  1165. part.Material = item.Material
  1166. data = 5
  1167. elseif maf >= 76 and maf <= 88 then
  1168. local item = dic.BushsBakedBeans
  1169. part.Size = item.Size
  1170. part.Color = item.Color
  1171. part.Material = item.Material
  1172. data = 6
  1173. elseif maf >= 89 and maf <= 100 then
  1174. local item = dic.SnowBerry
  1175. part.Size = item.Size
  1176. part.Color = item.Color
  1177. part.Material = item.Material
  1178. data = 7
  1179. end
  1180. end
  1181. if fs ~= nil then
  1182. part.Position = fs.Position
  1183. local click = Instance.new("ClickDetector",part)
  1184. fruitcount = fruitcount + 1
  1185. local pla
  1186. click.MouseClick:Connect(function(plr)
  1187. pla = plr
  1188. fruitcount = fruitcount - 1
  1189. if plr:FindFirstChild("GrowBrick") ~= nil then
  1190. plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",data)
  1191. part:Destroy()
  1192. playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
  1193. end
  1194. end)
  1195. end
  1196. end
  1197. end
  1198. end
  1199. end
  1200. end
  1201. end
  1202. end))
  1203. coroutine.resume(coroutine.create(function()
  1204. while wait(5) do
  1205. if Hunger > 0 then
  1206. Hunger = Hunger - 1
  1207. if StarvingAlert then
  1208. StarvingAlert = false
  1209. end
  1210. else
  1211. Health = Health - 2
  1212. if not StarvingAlert then
  1213. StarvingAlert = true
  1214. remote:FireClient(Player,"starving")
  1215. end
  1216. Size = Size - (Size*.05)
  1217. local rayorigin2 = brick.Position
  1218. local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1219. local raycastParams = RaycastParams.new()
  1220. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1221. raycastParams.FilterDescendantsInstances = {brick}
  1222. local ray = workspace:Raycast(
  1223. rayorigin2,
  1224. raydirection2,
  1225. raycastParams
  1226. )
  1227. if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
  1228. brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
  1229. if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
  1230. brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
  1231. end
  1232. end
  1233. end
  1234. if Health + 2 < 100 and Hunger > 0 then
  1235. Health = Health + 2
  1236. Hunger = Hunger - 1
  1237. elseif Health < 100 and Hunger > 0 then
  1238. Health = 100
  1239. Hunger = Hunger - 1
  1240. end
  1241. hunger.Text = "🍗 "..tostring(Hunger)
  1242. health.Text = "💕"..tostring(Health)
  1243. end
  1244. end))
  1245.  
  1246. function eat(part)
  1247. local typ = part.Type.Value
  1248. local sat = dic[items[typ]].Saturation
  1249. local siz = (Size*2)/10
  1250. local sat1 = sat*.75
  1251. local color = Color3.fromRGB(math.floor(brick.Color.R*255),math.floor(brick.Color.G*255),math.floor(brick.Color.B*255))
  1252. Hunger = Hunger + math.floor((sat1/(1+siz)))
  1253. if Hunger > 100 then Hunger = 100 end
  1254. local sat2 = sat*.005
  1255. Size = Size + (sat2/(1+siz))
  1256. BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
  1257. BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
  1258. local rayorigin2 = brick.Position
  1259. local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1260. local raycastParams = RaycastParams.new()
  1261. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1262. raycastParams.FilterDescendantsInstances = {brick}
  1263. local ray = workspace:Raycast(
  1264. rayorigin2,
  1265. raydirection2,
  1266. raycastParams
  1267. )
  1268. if typ == 7 then
  1269. Speed = Speed + 0.25
  1270. elseif typ == 6 then
  1271. Defecation = Defecation + 1
  1272. end
  1273. DefeTick = DefeTick - 2
  1274. if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
  1275. brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
  1276. if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil and ray ~= nil and ray.Position ~= nil then
  1277. brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
  1278. end
  1279. end
  1280. Speede = Speed * Size
  1281. hunger.Text = "🍗 "..tostring(Hunger)
  1282. health.Text = "💕"..tostring(Health)
  1283. local rbies = math.floor(color.R*255)
  1284. local gbies = math.floor(color.G*255)
  1285. local bbies = math.floor(color.B*255)
  1286. if typ == 1 then
  1287. if rbies + 2 < 256 then
  1288. rbies = rbies + 2
  1289. else
  1290. rbies = 255
  1291. end
  1292. if gbies - 1 > -1 then
  1293. gbies = gbies - 1
  1294. else
  1295. gbies = 0
  1296. end
  1297. if bbies - 1 > -1 then
  1298. bbies = bbies - 1
  1299. else
  1300. bbies = 0
  1301. end
  1302. elseif typ == 2 then
  1303. if rbies + 2 < 256 then
  1304. rbies = rbies + 2
  1305. else
  1306. rbies = 255
  1307. end
  1308. if gbies + 1 < 256 then
  1309. gbies = gbies + 1
  1310. else
  1311. gbies = 255
  1312. end
  1313. if bbies - 1 > -1 then
  1314. bbies = bbies - 1
  1315. else
  1316. bbies = 0
  1317. end
  1318. elseif typ == 3 then
  1319. if rbies - 1 > -1 then
  1320. rbies = rbies - 1
  1321. else
  1322. rbies = 0
  1323. end
  1324. if gbies - 1 > -1 then
  1325. gbies = gbies - 1
  1326. else
  1327. gbies = 0
  1328. end
  1329. if bbies + 2 < 256 then
  1330. bbies = bbies + 2
  1331. else
  1332. bbies = 255
  1333. end
  1334. elseif typ == 4 then
  1335. if rbies - 1 > -1 then
  1336. rbies = rbies - 1
  1337. else
  1338. rbies = 0
  1339. end
  1340. if gbies + 2 < 256 then
  1341. gbies = gbies + 2
  1342. else
  1343. gbies = 255
  1344. end
  1345. if bbies - 1 > -1 then
  1346. bbies = bbies - 1
  1347. else
  1348. bbies = 0
  1349. end
  1350. elseif typ == 5 then
  1351. if rbies + 2 < 256 then
  1352. rbies = rbies + 2
  1353. else
  1354. rbies = 255
  1355. end
  1356. if gbies - 1 > -1 then
  1357. gbies = gbies - 1
  1358. else
  1359. gbies = 0
  1360. end
  1361. if bbies + 2 < 256 then
  1362. bbies = bbies + 2
  1363. else
  1364. bbies = 255
  1365. end
  1366. elseif typ == 6 then
  1367. if rbies - 2 > -1 then
  1368. rbies = rbies - 2
  1369. else
  1370. rbies = 0
  1371. end
  1372. if gbies - 2 > -1 then
  1373. gbies = gbies - 2
  1374. else
  1375. gbies = 0
  1376. end
  1377. if bbies - 2 > -1 then
  1378. bbies = bbies - 2
  1379. else
  1380. bbies = 0
  1381. end
  1382. elseif typ == 7 then
  1383. if rbies + 2 < 256 then
  1384. rbies = rbies + 2
  1385. else
  1386. rbies = 255
  1387. end
  1388. if gbies + 2 < 256 then
  1389. gbies = gbies + 2
  1390. else
  1391. gbies = 255
  1392. end
  1393. if bbies + 2 < 256 then
  1394. bbies = bbies + 2
  1395. else
  1396. bbies = 255
  1397. end
  1398. elseif typ == 15 then
  1399. if rbies + 20 < 256 then
  1400. rbies = rbies + 20
  1401. else
  1402. rbies = 255
  1403. end
  1404. if gbies - 10 > -1 then
  1405. gbies = gbies - 10
  1406. else
  1407. gbies = 0
  1408. end
  1409. if bbies - 10 > -1 then
  1410. bbies = bbies - 10
  1411. else
  1412. bbies = 0
  1413. end
  1414. elseif typ == 16 then
  1415. if rbies + 20 < 256 then
  1416. rbies = rbies + 20
  1417. else
  1418. rbies = 255
  1419. end
  1420. if gbies + 10 < 256 then
  1421. gbies = gbies + 10
  1422. else
  1423. gbies = 255
  1424. end
  1425. if bbies - 10 > -1 then
  1426. bbies = bbies - 10
  1427. else
  1428. bbies = 0
  1429. end
  1430. elseif typ == 17 then
  1431. if rbies - 10 > -1 then
  1432. rbies = rbies - 10
  1433. else
  1434. rbies = 0
  1435. end
  1436. if gbies - 10 > -1 then
  1437. gbies = gbies - 10
  1438. else
  1439. gbies = 0
  1440. end
  1441. if bbies + 20 < 256 then
  1442. bbies = bbies + 20
  1443. else
  1444. bbies = 255
  1445. end
  1446. elseif typ == 18 then
  1447. if rbies - 10 > -1 then
  1448. rbies = rbies - 10
  1449. else
  1450. rbies = 0
  1451. end
  1452. if gbies + 20 < 256 then
  1453. gbies = gbies + 20
  1454. else
  1455. gbies = 255
  1456. end
  1457. if bbies - 10 > -1 then
  1458. bbies = bbies - 10
  1459. else
  1460. bbies = 0
  1461. end
  1462. elseif typ == 19 then
  1463. if rbies + 20 < 256 then
  1464. rbies = rbies + 20
  1465. else
  1466. rbies = 255
  1467. end
  1468. if gbies - 10 > -1 then
  1469. gbies = gbies - 10
  1470. else
  1471. gbies = 0
  1472. end
  1473. if bbies + 20 < 256 then
  1474. bbies = bbies + 20
  1475. else
  1476. bbies = 255
  1477. end
  1478. elseif typ == 20 then
  1479. if rbies - 20 > -1 then
  1480. rbies = rbies - 20
  1481. else
  1482. rbies = 0
  1483. end
  1484. if gbies - 20 > -1 then
  1485. gbies = gbies - 20
  1486. else
  1487. gbies = 0
  1488. end
  1489. if bbies - 20 > -1 then
  1490. bbies = bbies - 20
  1491. else
  1492. bbies = 0
  1493. end
  1494. elseif typ == 21 then
  1495. if rbies + 20 < 256 then
  1496. rbies = rbies + 20
  1497. else
  1498. rbies = 255
  1499. end
  1500. if gbies + 20 < 256 then
  1501. gbies = gbies + 20
  1502. else
  1503. gbies = 255
  1504. end
  1505. if bbies + 20 < 256 then
  1506. bbies = bbies + 20
  1507. else
  1508. bbies = 255
  1509. end
  1510. end
  1511. R = rbies
  1512. G = gbies
  1513. B = bbies
  1514. brick.Color = Color3.fromRGB(rbies,gbies,bbies)
  1515. part:Destroy()
  1516. end
  1517.  
  1518. coroutine.resume(coroutine.create(function()
  1519. while wait() do
  1520. Position = brick.Position
  1521. Rotation = brick.Orientation
  1522. if not Following and Wandering and #FoodToEat == 0 then
  1523. local ranx = math.random(-2*Size,2*Size)
  1524. local ranz = math.random(-2*Size,2*Size)
  1525. local raycastParams = RaycastParams.new()
  1526. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1527. raycastParams.FilterDescendantsInstances = {brick}
  1528. local rayorigin = Vector3.new(ranx,(brick.Size.Y/2)+brick.Size.Y/2,ranz)+brick.Position
  1529. local raydirection = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1530. local ray = workspace:Raycast(
  1531. rayorigin,
  1532. raydirection,
  1533. raycastParams
  1534. )
  1535. local rayorigin2 = brick.Position
  1536. local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1537. local ray2 = workspace:Raycast(
  1538. rayorigin2,
  1539. raydirection2,
  1540. raycastParams
  1541. )
  1542. if ray and ray2 and ray.Position.Y == ray2.Position.Y then
  1543. local newpos = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
  1544. local mag = (brick.Position - newpos).Magnitude
  1545. local p = Instance.new("MeshPart")
  1546. p.Transparency = 1
  1547. p.CanCollide = false
  1548. p.Anchored = true
  1549. p.CFrame = CFrame.new(brick.Position,newpos)
  1550. local goal = {}
  1551. goal.Orientation = p.Orientation
  1552. local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
  1553. tween:Play()
  1554. wait(0.5)
  1555. local sped = 0.2*Speede
  1556. local waittime = mag/sped
  1557. local goal2 = {}
  1558. goal2.Position = newpos
  1559. if Size >= 10 then
  1560. local pa = Instance.new("MeshPart",workspace)
  1561. pa.Transparency = 1
  1562. pa.CanCollide = false
  1563. pa.Position = brick.Position+Vector3.new(0,brick.Size.Y,0)
  1564. pa.Size = brick.Size
  1565. pa.Anchored = true
  1566. local region = Region3.new(Vector3.new(pa.Position.X-(pa.Size.X/2),pa.Position.Y-(pa.Size.Y/2),pa.Position.Z-(pa.Size.Z/2)),Vector3.new(pa.Position.X+(pa.Size.X/2),pa.Position.Y+(pa.Size.Y/2),pa.Position.Z+(pa.Size.Z/2)))
  1567. local tab = workspace:FindPartsInRegion3(region,pa)
  1568. pa:Destroy()
  1569. local checkedplayers = {}
  1570. for i,v in pairs(tab) do
  1571. if v ~= nil and v.Parent.ClassName == "Model" and v.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  1572. local plr = v.Parent
  1573. if table.find(checkedplayers,plr) == nil and plr:FindFirstChild("HumanoidRootPart") ~= nil then
  1574. table.insert(checkedplayers,plr)
  1575. local offset = brick.Position - plr.HumanoidRootPart.Position
  1576. local goal = {}
  1577. goal.Position = Vector3.new(newpos.X,plr.HumanoidRootPart.Position.Y,newpos.Z) - Vector3.new(offset.X,0,offset.Z)
  1578. plr.HumanoidRootPart.Anchored = true
  1579. local g = TweenService:Create(plr.HumanoidRootPart, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal)
  1580. g:Play()
  1581. coroutine.resume(coroutine.create(function()
  1582. wait(waittime)
  1583. plr.HumanoidRootPart.Anchored = false
  1584. end))
  1585. end
  1586. end
  1587. end
  1588. end
  1589. local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
  1590. tween:Play()
  1591. Moving = true
  1592. wait(waittime)
  1593. Moving = false
  1594. LastSafePosition = brick.Position
  1595. Rotation = brick.Orientation
  1596. Position = brick.Position
  1597. end
  1598. wait(math.random(1.0,7.0))
  1599. elseif not Following and #FoodToEat > 0 then
  1600. local part = FoodToEat[1]
  1601. if part == nil or part.Parent == nil or part:FindFirstChild("Type") == nil then
  1602. table.remove(FoodToEat,1)
  1603. else
  1604. local raycastParams = RaycastParams.new()
  1605. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1606. raycastParams.FilterDescendantsInstances = {brick,part}
  1607. local rayorigin = part.Position
  1608. local raydirection = Vector3.new(0,(part.Size.Y+20)*-1,0)
  1609. local ray = workspace:Raycast(
  1610. rayorigin,
  1611. raydirection,
  1612. raycastParams
  1613. )
  1614. local rayorigin2 = brick.Position
  1615. local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1616. local ray2 = workspace:Raycast(
  1617. rayorigin2,
  1618. raydirection2,
  1619. raycastParams
  1620. )
  1621. if ray and ray2 and ray.Position.Y == ray2.Position.Y then
  1622. local vec
  1623. local number = brick.Position.X-part.Position.X
  1624. if number >= 0 then
  1625. vec = Vector3.new((brick.Size.X/2)+part.Size.X/2,0,0)
  1626. else
  1627. vec = -Vector3.new((brick.Size.X/2)+part.Size.X/2,0,0)
  1628. end
  1629. local newpos = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z) + vec
  1630. local p = Instance.new("MeshPart")
  1631. p.Transparency = 1
  1632. p.CanCollide = false
  1633. p.Anchored = true
  1634. p.CFrame = CFrame.new(brick.Position,newpos)
  1635. local goal = {}
  1636. goal.Orientation = p.Orientation
  1637. local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
  1638. tween:Play()
  1639. wait(0.5)
  1640. local mag = (ray.Position - ray2.Position).Magnitude
  1641. local sped = 0.2*Speede
  1642. local waittime = mag/sped
  1643. local goal2 = {}
  1644. goal2.Position = newpos
  1645. if Size >= 10 then
  1646. local pa = Instance.new("MeshPart",workspace)
  1647. pa.Transparency = 1
  1648. pa.CanCollide = false
  1649. pa.Position = brick.Position+Vector3.new(0,brick.Size.Y,0)
  1650. pa.Size = brick.Size
  1651. pa.Anchored = true
  1652. local region = Region3.new(Vector3.new(pa.Position.X-(pa.Size.X/2),pa.Position.Y-(pa.Size.Y/2),pa.Position.Z-(pa.Size.Z/2)),Vector3.new(pa.Position.X+(pa.Size.X/2),pa.Position.Y+(pa.Size.Y/2),pa.Position.Z+(pa.Size.Z/2)))
  1653. local tab = workspace:FindPartsInRegion3(region,pa)
  1654. pa:Destroy()
  1655. local checkedplayers = {}
  1656. for i,v in pairs(tab) do
  1657. if v ~= nil and v.Parent.ClassName == "Model" and v.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  1658. local plr = v.Parent
  1659. if table.find(checkedplayers,plr) == nil and plr:FindFirstChild("HumanoidRootPart") ~= nil then
  1660. table.insert(checkedplayers,plr)
  1661. local offset = brick.Position - plr.HumanoidRootPart.Position
  1662. local goal = {}
  1663. goal.Position = Vector3.new(newpos.X,plr.HumanoidRootPart.Position.Y,newpos.Z) - Vector3.new(offset.X,0,offset.Z)
  1664. plr.HumanoidRootPart.Anchored = true
  1665. local g = TweenService:Create(plr.HumanoidRootPart, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal)
  1666. g:Play()
  1667. coroutine.resume(coroutine.create(function()
  1668. wait(waittime)
  1669. plr.HumanoidRootPart.Anchored = false
  1670. end))
  1671. end
  1672. end
  1673. end
  1674. end
  1675. local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
  1676. tween:Play()
  1677. Moving = true
  1678. wait(waittime)
  1679. brick.BillboardGui.FoodBackground.FoodBar.BackgroundTransparency = 1
  1680. brick.BillboardGui.FoodBackground.BackgroundTransparency = 1
  1681. brick.BillboardGui.FoodBackground.FoodBar.Size = UDim2.new(0,0,1,0)
  1682. local goal3 = {}
  1683. goal3.BackgroundTransparency = 0.5
  1684. local goal3a = {}
  1685. goal3a.BackgroundTransparency = 0.5
  1686. local tween1 = TweenService:Create(brick.BillboardGui.FoodBackground, TweenInfo.new(0.3,Enum.EasingStyle.Linear),goal3)
  1687. local tween2 = TweenService:Create(brick.BillboardGui.FoodBackground.FoodBar, TweenInfo.new(0.3,Enum.EasingStyle.Linear),goal3a)
  1688. tween1:Play()
  1689. tween2:Play()
  1690. wait(0.3)
  1691. local sound = brick:FindFirstChild("Eating")
  1692. if sound == nil then
  1693. sound = Instance.new("Sound",brick)
  1694. end
  1695. sound.Name = "Eating"
  1696. sound.SoundId = "rbxassetid://5841604328"
  1697. sound.Volume = 0.4
  1698. sound.Looped = true
  1699. sound.Pitch = 1.25
  1700. sound:Play()
  1701. local bep = 0
  1702. while bep < 1 do
  1703. if bep + (0.041666666666667*(0.33333333333333+Size/3)) < 1 then
  1704. bep = bep + (0.041666666666667*(0.33333333333333+Size/3))
  1705. else
  1706. bep = 1
  1707. end
  1708. if brick ~= nil and brick.Parent ~= nil then
  1709. brick.BillboardGui.FoodBackground.FoodBar.Size = UDim2.new(bep,0,1,0)
  1710. else
  1711. break
  1712. end
  1713. wait(1/6)
  1714. end
  1715. sound:Stop()
  1716. if part ~= nil and part.Parent ~= nil and part:FindFirstChild("Type") ~= nil then
  1717. eat(part)
  1718. end
  1719. local goal5 = {}
  1720. goal5.BackgroundTransparency = 1
  1721. local goal5a = {}
  1722. goal5a.BackgroundTransparency = 1
  1723. local tween1 = TweenService:Create(brick.BillboardGui.FoodBackground, TweenInfo.new(0.5,Enum.EasingStyle.Linear),goal5)
  1724. local tween2 = TweenService:Create(brick.BillboardGui.FoodBackground.FoodBar, TweenInfo.new(0.5,Enum.EasingStyle.Linear),goal5a)
  1725. tween1:Play()
  1726. tween2:Play()
  1727. table.remove(FoodToEat,1)
  1728. wait(math.random(0.33,0.65))
  1729. else
  1730. local part = FoodToEat[1]
  1731. local data = part.Type.Value
  1732. Player:FindFirstChild("GrowBrick"):FireClient(Player,"Pickup",data)
  1733. part.Parent = nil
  1734. table.remove(FoodToEat,1)
  1735. end
  1736. end
  1737. elseif Following then
  1738. local raycastParams = RaycastParams.new()
  1739. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  1740. raycastParams.FilterDescendantsInstances = {Player.Character,brick}
  1741. local rayyorigin = Player.Character.Head.Position + Vector3.new(0,5,0)
  1742. local rayydirection = Vector3.new(0,-100,0)
  1743. local rayy = workspace:Raycast(
  1744. rayyorigin,
  1745. rayydirection,
  1746. raycastParams
  1747. )
  1748. local rayyorigin2 = brick.Position
  1749. local rayydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
  1750. local rayy2 = workspace:Raycast(
  1751. rayyorigin2,
  1752. rayydirection2,
  1753. raycastParams
  1754. )
  1755. if rayy and rayy2 and rayy.Position.Y == rayy2.Position.Y and (rayy.Position-rayy2.Position).Magnitude > 1.25*Size and Boredom < 100 then
  1756. moveForwards(rayy.Position)
  1757. local cha = math.random(1,4)
  1758. if cha == 1 then
  1759. Boredom = Boredom + 1
  1760. end
  1761. elseif rayy and rayy2 and (rayy.Position-rayy2.Position).Magnitude <= 1.25*Size and Boredom < 100 then
  1762. Boredom = Boredom + 1
  1763. elseif Boredom >= 100 then
  1764. Following = false
  1765. Boredom = 0
  1766. end
  1767. wait()
  1768. else
  1769. wait(math.random(1.0,4.0))
  1770. end
  1771. end
  1772. end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement