Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This work is protected under copyright
- -- Any attempts to steal and publish this work will be taken action against under law.
- --
- -- © 2020, Denizen Donut, All rights reserved.
- wait(2)
- fruitmaxcount = 100
- local items = {
- "Apple",
- "Orange",
- "Blueberry",
- "Cabbage",
- "DragonFruit",
- "BushsBakedBeans",
- "SnowBerry",
- "Tier1Sapling",
- "Tier2Sapling",
- "Tier3Sapling",
- "Tier4Sapling",
- "Tier5Sapling",
- "BrickPoop",
- "Fertilizer",
- "AppleCompound",
- "OrangeCompound",
- "BlueberryCompound",
- "CabbageCompound",
- "DragonFruitCompound",
- "Log",
- "Stick",
- "StandingTorch"
- }
- local dic = {
- Apple = {
- Name = "Apple",
- Description = "The most common and basic food source. It's full of sugar, nutriant, and found everywhere!",
- Color = Color3.fromRGB(196, 40, 28),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.SmoothPlastic,
- Saturation = 25,
- Image = "http://www.roblox.com/asset/?id=5841401980"
- },
- Orange = {
- Name = "Orange",
- Description = "A less generic food source full of water. Bricks find these to be a very tasty treat!",
- Color = Color3.fromRGB(218, 133, 65),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.SmoothPlastic,
- Saturation = 53,
- Image = "http://www.roblox.com/asset/?id=5841402486"
- },
- Blueberry = {
- Name = "Blueberry",
- Description = "A thick capsule of sugar that explode with flavor. Bricks find these to look very pretty!",
- Color = Color3.fromRGB(13, 105, 172),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.SmoothPlastic,
- Saturation = 67,
- Image = "http://www.roblox.com/asset/?id=5841402851"
- },
- Cabbage = {
- Name = "Cabbage",
- 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.",
- Color = Color3.fromRGB(75, 151, 75),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.Slate,
- Saturation = 83,
- Image = "http://www.roblox.com/asset/?id=5841403181"
- },
- DragonFruit = {
- Name = "Dragon Fruit",
- 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.",
- Color = Color3.fromRGB(255, 102, 204),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.Sand,
- Saturation = 98,
- Image = "http://www.roblox.com/asset/?id=5841403563"
- },
- BushsBakedBeans = {
- Name = "Bush's Baked Beans",
- 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.",
- Color = Color3.fromRGB(86, 36, 36),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.Metal,
- Saturation = 113,
- Image = "http://www.roblox.com/asset/?id=5841403880"
- },
- SnowBerry = {
- Name = "Snow Berry",
- Description = "A berry that isn't very filling, yet full of stimulants. This will excite your brick and make it travel faster!",
- Color = Color3.fromRGB(231, 231, 236),
- Size = Vector3.new(0.75, 1, 0.75),
- Material = Enum.Material.SmoothPlastic,
- Saturation = 20,
- Image = "http://www.roblox.com/asset/?id=5841404303"
- },
- Tier1Sapling = {
- Name = "Tier 1 Sapling",
- Description = "A genetically modified apple sapling which grows many types of fruits, but mostly outputs apples.",
- Color = Color3.fromRGB(124, 156, 107),
- Size = Vector3.new(0.75, 1.5, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842132663"
- },
- Tier2Sapling = {
- Name = "Tier 2 Sapling",
- Description = "A genetically modified orange sapling which grows many types of fruits. It mostly grows apples and oranges but sometimes can sprout blueberries.",
- Color = Color3.fromRGB(124, 156, 107),
- Size = Vector3.new(0.75, 1.5, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842132922"
- },
- Tier3Sapling = {
- Name = "Tier 3 Sapling",
- 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.",
- Color = Color3.fromRGB(124, 156, 107),
- Size = Vector3.new(0.75, 1.5, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842133357"
- },
- Tier4Sapling = {
- Name = "Tier 4 Sapling",
- 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.",
- Color = Color3.fromRGB(124, 156, 107),
- Size = Vector3.new(0.75, 1.5, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842133570"
- },
- Tier5Sapling = {
- Name = "Tier 5 Sapling",
- 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.",
- Color = Color3.fromRGB(124, 156, 107),
- Size = Vector3.new(0.75, 1.5, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842133857"
- },
- BrickPoop = {
- Name = "Brick Poop",
- Description = "Some smelly and yucky stuff that came out of your brick. Used for fertilizer.",
- Color = Color3.fromRGB(106, 57, 9),
- Size = Vector3.new(0.75, 0.75, 0.75),
- Material = Enum.Material.Granite,
- Image = "http://www.roblox.com/asset/?id=5842162205"
- },
- Fertilizer = {
- Name = "Fertilizer",
- Description = "Very gross and smelly, but saplings love it.",
- Color = Color3.fromRGB(106, 57, 9),
- Size = Vector3.new(0.75, 1.75, 0.75),
- Material = Enum.Material.Slate,
- Image = "http://www.roblox.com/asset/?id=5842171608"
- },
- AppleCompound = {
- Name = "Apple Compound",
- Description = "A bunch of apples that have been fused together to create an even bigger more powerful apple! These are very very filling.",
- Color = Color3.fromRGB(151, 0, 0),
- Size = Vector3.new(1.25, 2, 1.25),
- Material = Enum.Material.Slate,
- Saturation = 375,
- Image = "http://www.roblox.com/asset/?id=5853176500"
- },
- OrangeCompound = {
- Name = "Orange Compound",
- Description = "Congradulations! You are now the world record holder of the world's largest orange!",
- Color = Color3.fromRGB(170, 85, 0),
- Size = Vector3.new(1.25, 2, 1.25),
- Material = Enum.Material.Slate,
- Saturation = 795,
- Image = "http://www.roblox.com/asset/?id=5853176830"
- },
- BlueberryCompound = {
- Name = "Blueberry Compound",
- Description = "You could probably just keep this as a bean bag. A very big fleshy bean bag.",
- Color = Color3.fromRGB(33, 84, 185),
- Size = Vector3.new(1.25, 2, 1.25),
- Material = Enum.Material.Slate,
- Saturation = 1005,
- Image = "http://www.roblox.com/asset/?id=5853177154"
- },
- CabbageCompound = {
- Name = "Cabbage Compound",
- Description = "Wow okay now that's ALOT of fiber.",
- Color = Color3.fromRGB(44, 101, 29),
- Size = Vector3.new(1.25, 2, 1.25),
- Material = Enum.Material.Slate,
- Saturation = 1245,
- Image = "http://www.roblox.com/asset/?id=5853177599"
- },
- DragonFruitCompound = {
- Name = "Dragon Fruit Compound",
- Description = "BIG PINK FRUIT YUMMY BIG PINK SUPER NEON BRIGHT YUMMY PINK NO GREEN YUMMY PINK YUM YUM",
- Color = Color3.fromRGB(255,0,255),
- Size = Vector3.new(1.25, 2, 1.25),
- Material = Enum.Material.Slate,
- Saturation = 1470,
- Image = "http://www.roblox.com/asset/?id=5853178072"
- },
- Log = {
- Name = "Log",
- Description = "A fresh log harvested from a fresh tree.",
- Color = Color3.fromRGB(105, 63, 40),
- Size = Vector3.new(10, 2, 2),
- Material = Enum.Material.Wood,
- Image = "http://www.roblox.com/asset/?id=6326165327"
- },
- Stick = {
- Name = "Stick",
- Description = "A very small log which is used as a handle or for supporting a structure.",
- Color = Color3.fromRGB(105, 63, 40),
- Size = Vector3.new(5, 1, 1),
- Material = Enum.Material.Wood,
- Image = "http://www.roblox.com/asset/?id=6326165733"
- },
- StandingTorch = {
- Name = "Standing Torch",
- Description = "A super cool torch that you can use to light up super cool things.",
- Color = Color3.fromRGB(105, 63, 40),
- Size = Vector3.new(2, 4, 2),
- Material = Enum.Material.Wood,
- Image = "http://www.roblox.com/asset/?id=6326164632"
- }
- }
- local Player = owner
- local remote
- if Player:FindFirstChild("GrowBrick") == nil then
- remote = Instance.new("RemoteEvent",Player)
- remote.Name = "GrowBrick"
- else
- remote = Player:FindFirstChild("GrowBrick")
- end
- --properties of brick
- local brick = Instance.new("Part")
- Name = nil
- FoodToEat = {}
- Size = 1
- Hunger = 100
- Health = 100
- Boredom = 0
- Defecation = 0
- DefeTick = 20
- Position = brick.Position
- Rotation = brick.Orientation
- Following = false
- Wandering = true
- LastSafePosition = nil
- Moving = false
- Tick = 0
- Speed = 4
- Speede = Speed * Size
- MoveRegion = nil
- StarvingAlert = false
- brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
- Instance.new("Folder",script).Name = "Trees-"..Player.Name
- local treetier = 0
- local R = math.floor(brick.Color.R*255)
- local G = math.floor(brick.Color.G*255)
- local B = math.floor(brick.Color.B*255)
- function spawnTree(pos)
- local Folder0 = Instance.new("Folder")
- local Part1 = Instance.new("Part")
- local Part2 = Instance.new("Part")
- local Part3 = Instance.new("Part")
- local Part4 = Instance.new("Part")
- local Part5 = Instance.new("Part")
- local Part6 = Instance.new("Part")
- local Part7 = Instance.new("Part")
- local Part8 = Instance.new("Part")
- local Part9 = Instance.new("Part")
- local Part10 = Instance.new("Part")
- local tier = Instance.new("IntValue")
- local tic = Instance.new("IntValue")
- tier.Value = treetier
- tier.Name = "Tier"
- tier.Parent = Folder0
- tic.Parent = Folder0
- tic.Value = Tick + 25
- tic.Name = "Tick"
- Folder0.Name = "Tree"
- Folder0.Parent = script:FindFirstChild("Trees-"..Player.Name)
- Part1.Name = "hitpart"
- Part1.Parent = Folder0
- Part1.Size = Vector3.new(1, 1, 1)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.CanCollide = false
- Part1.Locked = true
- Part1.Reflectance = 1
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = pos
- Part2.Name = "leaves"
- Part2.Parent = Folder0
- Part2.Position = Part1.Position + Vector3.new(0, 12, 0)
- Part2.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part2.Size = Vector3.new(5, 2, 5)
- Part2.Anchored = true
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.Locked = true
- Part2.Material = Enum.Material.Slate
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part3.Name = "trunk"
- Part3.Parent = Folder0
- Part3.Position = Part1.Position + Vector3.new(0, 3.5, 0)
- Part3.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part3.Size = Vector3.new(2, 10, 2)
- Part3.Anchored = true
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.Locked = true
- Part3.Material = Enum.Material.Wood
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part4.Name = "leaves"
- Part4.Parent = Folder0
- Part4.Position = Part1.Position + Vector3.new(0, 9.75, 0)
- Part4.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part4.Size = Vector3.new(9, 2.5, 9)
- Part4.Anchored = true
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.Locked = true
- Part4.Material = Enum.Material.Slate
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part5.Name = "FruitSpawner1"
- Part5.Parent = Folder0
- Part5.Position = Part1.Position + Vector3.new(-2.5, 8.25, -2.5)
- Part5.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part5.Transparency = 1
- Part5.Size = Vector3.new(1, 0.5, 1)
- Part5.Anchored = true
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.Locked = true
- Part5.Material = Enum.Material.Slate
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.CanCollide = false
- Part6.Name = "FruitSpawner2"
- Part6.Parent = Folder0
- Part6.Position = Part1.Position + Vector3.new(2.5, 8.25, -2.5)
- Part6.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part6.Transparency = 1
- Part6.Size = Vector3.new(1, 0.5, 1)
- Part6.Anchored = true
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.Locked = true
- Part6.Material = Enum.Material.Slate
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.CanCollide = false
- Part7.Name = "FruitSpawner3"
- Part7.CanCollide = false
- Part7.Parent = Folder0
- Part7.Position = Part1.Position + Vector3.new(4, 8.25, 0.5)
- Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part7.Transparency = 1
- Part7.Size = Vector3.new(1, 0.5, 1)
- Part7.Anchored = true
- Part7.BottomSurface = Enum.SurfaceType.Smooth
- Part7.Locked = true
- Part7.Material = Enum.Material.Slate
- Part7.TopSurface = Enum.SurfaceType.Smooth
- Part8.Name = "FruitSpawner4"
- Part8.Parent = Folder0
- Part8.Position = Part1.Position + Vector3.new(3.5, 8.25, 3)
- Part8.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part8.Transparency = 1
- Part8.Size = Vector3.new(1, 0.5, 1)
- Part8.Anchored = true
- Part8.BottomSurface = Enum.SurfaceType.Smooth
- Part8.Locked = true
- Part8.Material = Enum.Material.Slate
- Part8.TopSurface = Enum.SurfaceType.Smooth
- Part8.CanCollide = false
- Part9.Name = "FruitSpawner5"
- Part9.Parent = Folder0
- Part9.Position = Part1.Position + Vector3.new(-1, 8.25, 3)
- Part9.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part9.Transparency = 1
- Part9.Size = Vector3.new(1, 0.5, 1)
- Part9.Anchored = true
- Part9.BottomSurface = Enum.SurfaceType.Smooth
- Part9.Locked = true
- Part9.Material = Enum.Material.Slate
- Part9.TopSurface = Enum.SurfaceType.Smooth
- Part9.CanCollide = false
- Part10.Name = "FruitSpawner6"
- Part10.Parent = Folder0
- Part10.Position = Part1.Position + Vector3.new(-3.5, 8.25, 0)
- Part10.Color = Color3.new(0.294118, 0.592157, 0.294118)
- Part10.Transparency = 1
- Part10.Size = Vector3.new(1, 0.5, 1)
- Part10.Anchored = true
- Part10.BottomSurface = Enum.SurfaceType.Smooth
- Part10.Locked = true
- Part10.Material = Enum.Material.Slate
- Part10.TopSurface = Enum.SurfaceType.Smooth
- Part10.CanCollide = false
- return Folder0
- end
- local bap = 0
- function playSound(id,volume,pitch,parent,namer,timer)
- if id ~= nil and volume ~= nil and pitch ~= nil and parent ~= nil and namer ~= nil then
- bap = bap + 1
- local oldbap = bap
- local sound = parent:FindFirstChild(namer)
- if sound == nil then
- sound = Instance.new("Sound",parent)
- end
- if sound ~= nil and sound.Parent ~= nil then
- sound.Volume = volume
- sound.SoundId = "rbxassetid://"..tostring(id)
- sound.Pitch = pitch
- sound.Name = namer
- sound:Play()
- if timer ~= nil then
- coroutine.resume(coroutine.create(function()
- wait(timer)
- if bap == oldbap then
- sound:Stop()
- end
- end))
- end
- end
- end
- end
- function spawnTorch(pos,mas)
- local Model0 = Instance.new("Model")
- local Part1 = Instance.new("Part")
- local Part2 = Instance.new("Part")
- local Part3 = Instance.new("Part")
- local Part4 = Instance.new("Part")
- local Part5 = Instance.new("Part")
- local Part6 = Instance.new("Part")
- local Part7 = Instance.new("Part")
- local Part8 = Instance.new("Part")
- local Part9 = Instance.new("Part")
- local Part10 = Instance.new("Part")
- local Part11 = Instance.new("Part")
- local Part12 = Instance.new("Part")
- local Part13 = Instance.new("Part")
- local Part14 = Instance.new("Part")
- local Fire15 = Instance.new("Fire")
- local Part16 = Instance.new("Part")
- local PointLight17 = Instance.new("PointLight")
- local Part19 = Instance.new("Part")
- Model0.Name = "Standing Torch"
- Model0.Parent = mas
- Model0.PrimaryPart = Part12
- Part1.Name = "Tripod"
- Part1.Parent = Model0
- Part1.Orientation = Vector3.new(30, 0, 0)
- Part1.Position = Vector3.new(-0.000365999993, 1.37948096, -0.730346978)
- Part1.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part1.Size = Vector3.new(0.5, 2.75, 0.5)
- Part1.Anchored = true
- Part1.Locked = true
- Part1.Material = Enum.Material.Wood
- Part2.Name = "Tripod"
- Part2.Parent = Model0
- Part2.Orientation = Vector3.new(30, 120, 0)
- Part2.Position = Vector3.new(-0.565231025, 1.38970196, 0.326691002)
- Part2.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part2.Size = Vector3.new(0.5, 2.75, 0.5)
- Part2.Anchored = true
- Part2.Locked = true
- Part2.Material = Enum.Material.Wood
- Part3.Name = "Tripod"
- Part3.Parent = Model0
- Part3.Orientation = Vector3.new(30, -120, 0)
- Part3.Position = Vector3.new(0.642310977, 1.31578696, 0.313324004)
- Part3.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part3.Size = Vector3.new(0.5, 2.75, 0.5)
- Part3.Anchored = true
- Part3.Locked = true
- Part3.Material = Enum.Material.Wood
- Part4.Name = "Cage"
- Part4.Parent = Model0
- Part4.Orientation = Vector3.new(15, -90, 0)
- Part4.Position = Vector3.new(0.366115987, 5.36940813, -0.000335999997)
- Part4.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part4.Size = Vector3.new(0.125, 1.75, 0.125)
- Part4.Anchored = true
- Part4.Locked = true
- Part4.Material = Enum.Material.Slate
- Part5.Name = "Cage"
- Part5.Parent = Model0
- Part5.Orientation = Vector3.new(-15, -90, 0)
- Part5.Position = Vector3.new(-0.383884013, 5.36940813, -0.000335999997)
- Part5.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part5.Size = Vector3.new(0.125, 1.75, 0.125)
- Part5.Anchored = true
- Part5.Locked = true
- Part5.Material = Enum.Material.Slate
- Part6.Name = "Cage"
- Part6.Parent = Model0
- Part6.Orientation = Vector3.new(-15, -135, 0)
- Part6.Position = Vector3.new(-0.274048001, 5.36940813, -0.265502989)
- Part6.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part6.Size = Vector3.new(0.125, 1.75, 0.125)
- Part6.Anchored = true
- Part6.Locked = true
- Part6.Material = Enum.Material.Slate
- Part7.Name = "Cage"
- Part7.Parent = Model0
- Part7.Orientation = Vector3.new(15, -135, 0)
- Part7.Position = Vector3.new(0.256278992, 5.36940813, 0.26483199)
- Part7.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part7.Size = Vector3.new(0.125, 1.75, 0.125)
- Part7.Anchored = true
- Part7.Locked = true
- Part7.Material = Enum.Material.Slate
- Part8.Name = "Cage"
- Part8.Parent = Model0
- Part8.Orientation = Vector3.new(-15, 180, 0)
- Part8.Position = Vector3.new(-0.00888399966, 5.36940813, -0.375319988)
- Part8.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part8.Size = Vector3.new(0.125, 1.75, 0.125)
- Part8.Anchored = true
- Part8.Locked = true
- Part8.Material = Enum.Material.Slate
- Part9.Name = "Cage"
- Part9.Parent = Model0
- Part9.Orientation = Vector3.new(15, 180, 0)
- Part9.Position = Vector3.new(-0.00888399966, 5.36940813, 0.374680012)
- Part9.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part9.Size = Vector3.new(0.125, 1.75, 0.125)
- Part9.Anchored = true
- Part9.Locked = true
- Part9.Material = Enum.Material.Slate
- Part10.Name = "Cage"
- Part10.Parent = Model0
- Part10.Orientation = Vector3.new(-15, 135, 0)
- Part10.Position = Vector3.new(0.271872997, 5.36940813, -0.259032995)
- Part10.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part10.Size = Vector3.new(0.125, 1.75, 0.125)
- Part10.Anchored = true
- Part10.Locked = true
- Part10.Material = Enum.Material.Slate
- Part11.Name = "Cage"
- Part11.Parent = Model0
- Part11.Orientation = Vector3.new(15, 135, 0)
- Part11.Position = Vector3.new(-0.258450001, 5.36940813, 0.271286011)
- Part11.Color = Color3.new(0.8, 0.556863, 0.411765)
- Part11.Size = Vector3.new(0.125, 1.75, 0.125)
- Part11.Anchored = true
- Part11.Locked = true
- Part11.Material = Enum.Material.Slate
- Part12.Name = "HitPart"
- Part12.Parent = Model0
- Part12.Position = Vector3.new(0, 0.378405005, 0)
- Part12.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part12.Transparency = 1
- Part12.Size = Vector3.new(0.5, 0.5, 0.5)
- Part12.Anchored = true
- Part12.CanCollide = false
- Part12.Locked = true
- Part12.Material = Enum.Material.Wood
- Part13.Name = "Base"
- Part13.Parent = Model0
- Part13.Position = Vector3.new(-0.000365999993, 4.55469084, -0.000335999997)
- Part13.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part13.Size = Vector3.new(1, 0.25, 1)
- Part13.Anchored = true
- Part13.Locked = true
- Part13.Material = Enum.Material.Wood
- Part14.Name = "Coal"
- Part14.Parent = Model0
- Part14.Position = Vector3.new(-0.000365999993, 4.86718607, -0.000335999997)
- Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part14.Size = Vector3.new(0.5, 0.375, 0.5)
- Part14.Anchored = true
- Part14.Locked = true
- Part14.Material = Enum.Material.Slate
- Fire15.Parent = Part14
- Fire15.Size = 2
- Part16.Name = "light"
- Part16.Parent = Model0
- Part16.Position = Vector3.new(-0.000365999993, 6.86718988, -0.000335999997)
- Part16.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part16.Transparency = 1
- Part16.Size = Vector3.new(0.5, 0.375, 0.5)
- Part16.Anchored = true
- Part16.CanCollide = false
- Part16.Locked = true
- Part16.Material = Enum.Material.Slate
- PointLight17.Parent = Part16
- PointLight17.Color = Color3.new(1, 0.717647, 0)
- PointLight17.Range = 60
- PointLight17.Shadows = true
- Part19.Name = "Baser"
- Part19.Parent = Model0
- Part19.Position = Vector3.new(-0.000365999993, 3.17971802, -0.000335999997)
- Part19.Color = Color3.new(0.411765, 0.25098, 0.156863)
- Part19.Size = Vector3.new(0.5, 2.5, 0.5)
- Part19.Anchored = true
- Part19.Locked = true
- Part19.Material = Enum.Material.Wood
- Model0:MoveTo(pos)
- return Model0
- end
- remote.OnServerEvent:Connect(function(plr,mode,data)
- if mode == "Begin" then
- Name = data
- remote:FireClient(plr,script)
- elseif mode == "Drop" then
- local item = dic[items[data]]
- local dat = data
- local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
- part.Material = item.Material
- part.Color = item.Color
- part.Size = item.Size
- part.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,1.5,-3)
- local click = Instance.new("ClickDetector",part)
- local int = Instance.new("IntValue",part)
- int.Name = "Type"
- int.Value = dat
- local pla
- click.MouseClick:Connect(function(plr)
- pla = plr
- if plr:FindFirstChild("GrowBrick") ~= nil then
- plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",int.Value)
- part:Destroy()
- if plr == Player then
- playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
- end
- end
- end)
- elseif mode == "Use" then
- local item = dic[items[data[1]]]
- local dat = data[1]
- local pos = data[2]
- local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
- part.Material = item.Material
- part.Color = item.Color
- part.Size = item.Size
- part.Position = pos
- playSound(5035412139,1,3,Player.Character.Head,"Ding")
- local int = Instance.new("IntValue",part)
- int.Name = "Type"
- int.Value = dat
- local click = Instance.new("ClickDetector",part)
- table.insert(FoodToEat,part)
- local pla
- click.MouseClick:Connect(function(plr)
- pla = plr
- if plr:FindFirstChild("GrowBrick") ~= nil and plr == Player then
- plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",int.Value)
- part:Destroy()
- if plr == Player then
- playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
- end
- end
- end)
- elseif mode == "Tree" then
- treetier = data[2]
- spawnTree(data[1])
- playSound(4676738150,1,1.5,Player.Character.Head,"Pop")
- elseif mode == "Whistle" then
- playSound(2286309043,1,2.5,Player.Character.Head,"Whistle")
- Boredom = 0
- --Following = true
- elseif mode == "Craft" then
- playSound(866697902,1,1,Player.Character.Head,"Craft1")
- playSound(3433989587,1,1.25,Player.Character.Head,"Craft2",1.93)
- elseif mode == "Demolish" then
- if data.Parent.Parent.Name == "Trees-"..Player.Name then
- data.Parent:Destroy()
- playSound(4056786383,1,1,Player.Character.Head,"Grab")
- end
- elseif mode == "Torch" then
- playSound(4676738150,1,1.5,Player.Character.Head,"Pop")
- local mod = spawnTorch(data,script:FindFirstChild("Trees-"..Player.Name))
- coroutine.resume(coroutine.create(function()
- while wait(.1) do
- if mod ~= nil and mod.Parent ~= nil then
- local light = mod.light.PointLight
- local mth = math.random(550,600)/10
- light.Range = mth
- else
- break
- end
- end
- end))
- elseif mode == "Quit" then
- brick:Destroy()
- script:FindFirstChild("Trees-"..Player.Name)
- script:Destroy()
- end
- end)
- repeat wait(1) until Name ~= nil
- local TweenService = game:GetService("TweenService")
- brick.Name = "Brick"..Player.Name
- brick.Parent = workspace
- brick.Size = Vector3.new(0.5,0.25,0.5)
- brick.Position = Player.Character.Head.Position - Vector3.new(-2,4,0)
- --[[local bodyGyro = Instance.new("BodyGyro",brick)
- bodyGyro.MaxTorque = Vector3.new(400000,0,400000)
- bodyGyro.CFrame = brick.CFrame
- bodyGyro.D = 1250
- bodyGyro.P = 3000]]
- -- Instances:
- local BillboardGui
- local Frame
- local namer
- local hunger
- local health
- local bar
- local FoodBackground
- local FoodBar
- function findPlayer(name)
- return game.Players:FindFirstChild(name)
- end
- function gui()
- BillboardGui = Instance.new("BillboardGui")
- Frame = Instance.new("Frame")
- namer = Instance.new("TextBox")
- hunger = Instance.new("TextBox")
- health = Instance.new("TextBox")
- bar = Instance.new("TextBox")
- FoodBackground = Instance.new("Frame")
- FoodBar = Instance.new("Frame")
- --Properties:
- BillboardGui.Parent = brick
- BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- BillboardGui.Active = true
- BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
- BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
- Frame.Parent = BillboardGui
- Frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- Frame.BackgroundTransparency = 1.000
- Frame.Size = UDim2.new(1, 0, 0.800000012, 0)
- namer.Name = "namer"
- namer.Parent = Frame
- namer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- namer.BackgroundTransparency = 1.000
- namer.Size = UDim2.new(1, 0, 0.649999976, 0)
- namer.Font = Enum.Font.GothamSemibold
- namer.Text = "Brick"
- namer.TextColor3 = Color3.fromRGB(255, 255, 255)
- namer.TextScaled = true
- namer.TextSize = 14.000
- namer.TextWrapped = true
- namer.TextYAlignment = Enum.TextYAlignment.Bottom
- hunger.Name = "hunger"
- hunger.Parent = Frame
- hunger.BackgroundColor3 = Color3.fromRGB(255, 119, 0)
- hunger.BackgroundTransparency = 1.000
- hunger.Position = UDim2.new(0, 0, 0.699999988, 0)
- hunger.Size = UDim2.new(0.5, 0, 0.300000012, 0)
- hunger.Font = Enum.Font.GothamSemibold
- hunger.Text = "🍗 0"
- hunger.TextColor3 = Color3.fromRGB(255, 128, 0)
- hunger.TextScaled = true
- hunger.TextSize = 14.000
- hunger.TextWrapped = true
- hunger.TextXAlignment = Enum.TextXAlignment.Right
- hunger.TextYAlignment = Enum.TextYAlignment.Top
- health.Name = "health"
- health.Parent = Frame
- health.AnchorPoint = Vector2.new(1, 0)
- health.BackgroundColor3 = Color3.fromRGB(255, 119, 0)
- health.BackgroundTransparency = 1.000
- health.Position = UDim2.new(1, 0, 0.699999988, 0)
- health.Size = UDim2.new(0.5, 0, 0.300000012, 0)
- health.Font = Enum.Font.GothamSemibold
- health.Text = "💕0"
- health.TextColor3 = Color3.fromRGB(255, 0, 0)
- health.TextScaled = true
- health.TextSize = 14.000
- health.TextWrapped = true
- health.TextXAlignment = Enum.TextXAlignment.Left
- health.TextYAlignment = Enum.TextYAlignment.Top
- bar.Name = "bar"
- bar.Parent = Frame
- bar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- bar.BorderSizePixel = 0
- bar.Position = UDim2.new(0, 0, 0.649999976, 0)
- bar.Size = UDim2.new(1, 0, 0.0250000004, 0)
- bar.Font = Enum.Font.Nunito
- bar.Text = ""
- bar.TextColor3 = Color3.fromRGB(255, 255, 255)
- bar.TextScaled = true
- bar.TextSize = 14.000
- bar.TextWrapped = true
- bar.TextYAlignment = Enum.TextYAlignment.Bottom
- FoodBackground.Name = "FoodBackground"
- FoodBackground.Parent = BillboardGui
- FoodBackground.AnchorPoint = Vector2.new(0, 1)
- FoodBackground.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- FoodBackground.BackgroundTransparency = 1
- FoodBackground.BorderSizePixel = 0
- FoodBackground.Position = UDim2.new(0, 0, 1, 0)
- FoodBackground.Size = UDim2.new(1, 0, 0.200000003, 0)
- FoodBar.Name = "FoodBar"
- FoodBar.Parent = FoodBackground
- FoodBar.AnchorPoint = Vector2.new(0, 1)
- FoodBar.BackgroundColor3 = Color3.fromRGB(255, 128, 0)
- FoodBar.BackgroundTransparency = 1
- FoodBar.BorderSizePixel = 0
- FoodBar.Position = UDim2.new(0, 0, 1, 0)
- FoodBar.Size = UDim2.new(0.5, 0, 1, 0)
- end
- -- Brick Movement Script
- local function moveTo(pos)
- if Moving then repeat wait() until not Moving end
- local p = Instance.new("MeshPart")
- p.Transparency = 1
- p.CanCollide = false
- p.Anchored = true
- p.CFrame = CFrame.new(brick.Position,pos)
- local goal = {}
- goal.Orientation = p.Orientation
- local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
- tween:Play()
- wait(0.5)
- local mag = (brick.Position - pos).Magnitude
- local sped = 0.2*Speede
- local waittime = mag/sped
- local goal2 = {}
- goal2.Position = Vector3.new(pos.X,pos.Y+brick.Size.Y/2,pos.Z)
- local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
- Moving = true
- tween:Play()
- Moving = false
- return waittime
- end
- local function moveForwards(pos)
- --if Moving then repeat wait() until not Moving end
- local p = Instance.new("MeshPart")
- p.Transparency = 1
- p.CanCollide = false
- p.Anchored = true
- p.CFrame = CFrame.new(brick.Position,pos)
- local goal = {}
- goal.Orientation = p.Orientation
- local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
- tween:Play()
- wait(0)
- local mag = (brick.Position - pos).Magnitude
- local sped = (0.2*Speede)/8
- local waittime = 0.125
- local goal2 = {}
- goal2.Position = (brick.CFrame * CFrame.new(0,0,-sped)).p
- local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
- Moving = true
- tween:Play()
- Moving = false
- return waittime
- end
- if true then
- Player.Chatted:Connect(function(msg)
- if string.lower(msg) == ";clrtrees" then
- if script:FindFirstChild("Trees-"..Player.Name) ~= nil then
- for i,v in pairs(script:FindFirstChild("Trees-"..Player.Name):GetChildren()) do
- if v.ClassName == "Folder" then
- v:Destroy()
- end
- end
- end
- elseif string.lower(string.sub(msg,1,9)) == ";setsize " then
- Size = tonumber(string.sub(msg,10))
- local rayorigin2 = brick.Position
- local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {brick}
- local ray = workspace:Raycast(
- rayorigin2,
- raydirection2,
- raycastParams
- )
- BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
- BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
- if brick ~= nil and brick.Parent ~= nil and brick.Size ~= nil and brick.Position ~= nil then
- brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
- if brick ~= nil and brick.Parent ~= nil and brick.Size ~= nil and brick.Position ~= nil then
- brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
- end
- end
- Speede = Speed * Size
- elseif string.lower(string.sub(msg,1,10)) == ";setspeed " then
- Speed = tonumber(string.sub(msg,11))
- Speede = Speed * Size
- elseif string.lower(string.sub(msg,1,11)) == ";sethealth " then
- local am = tonumber(string.sub(msg,12))
- Health = am
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- elseif string.lower(string.sub(msg,1,11)) == ";sethunger " then
- local am = tonumber(string.sub(msg,12))
- Hunger = am
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- end
- end)
- end
- repeat wait() until Name ~= nil
- gui()
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- namer.Text = Name
- --food and health
- local fruitcount = 0
- coroutine.resume(coroutine.create(function()
- while wait(1) do
- Tick = Tick + 1
- if DefeTick <= Tick then
- Defecation = Defecation + 1
- DefeTick = Tick + 20
- end
- if brick == nil or brick.Parent == nil then
- brick = Instance.new("Part")
- brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
- brick.Name = "Brick"..Player.Name
- brick.Parent = workspace
- brick.Position = LastSafePosition
- brick.Color = Color3.fromRGB(R,G,B)
- gui()
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- namer.Text = Name
- end
- if Defecation >= 2 then
- Defecation = 0
- local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
- playSound(357613509,1,1,brick,"Fart")
- part.Size = dic.BrickPoop.Size
- part.CFrame = brick.CFrame * CFrame.new(0,0,brick.Size.X-(part.Size.X/2))
- part.Color = dic.BrickPoop.Color
- part.Material = dic.BrickPoop.Material
- local int = Instance.new("IntValue",part)
- int.Name = "Type"
- int.Value = 13
- local click = Instance.new("ClickDetector",part)
- click.MouseClick:Connect(function(plr)
- if plr:FindFirstChild("GrowBrick") ~= nil then
- plr:FindFirstChild("GrowBrick"):FireClient(plr,"Pickup",13)
- playSound(4056786383,1,1.6,plr.Character.Head,"Grab")
- part:Destroy()
- end
- end)
- end
- remote:FireClient(Player,"Stats",{Hunger,Health,Boredom,Defecation,Speed,Size,Following,Wandering,Tick,DefeTick,brick.Color})
- if script:FindFirstChild("Trees-"..Player.Name) ~= nil then
- for i,v in pairs(script:FindFirstChild("Trees-"..Player.Name):GetChildren()) do
- if v.ClassName == "Folder" then
- local tic = v:FindFirstChild("Tick")
- if tic.Value <= Tick then
- tic.Value = Tick + 25
- if fruitcount < fruitmaxcount then
- local maf = math.random(1,6)
- local fs = v:FindFirstChild("FruitSpawner"..tostring(maf))
- local tier = v:FindFirstChild("Tier").Value
- local part = Instance.new("Part",script:FindFirstChild("Trees-"..Player.Name))
- local data = 0
- if tier == 1 then
- local maf = math.random(1,100)
- if maf >= 1 and maf <= 70 then
- local item = dic.Apple
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 1
- elseif maf >= 71 and maf <= 90 then
- local item = dic.Orange
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 2
- elseif maf >= 91 and maf <= 94 then
- local item = dic.Blueberry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 3
- elseif maf >= 95 and maf <= 97 then
- local item = dic.Cabbage
- part.Size = item.Size
- part.Color = item.Color
- data = 4
- part.Material = item.Material
- elseif maf >= 98 and maf <= 99 then
- local item = dic.DragonFruit
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 5
- elseif maf >= 100 and maf <= 100 then
- local item = dic.BushsBakedBeans
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 6
- end
- elseif tier == 2 then
- local maf = math.random(1,100)
- if maf >= 1 and maf <= 40 then
- local item = dic.Apple
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 1
- elseif maf >= 41 and maf <= 80 then
- local item = dic.Orange
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 2
- elseif maf >= 81 and maf <= 93 then
- local item = dic.Blueberry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 3
- elseif maf >= 94 and maf <= 97 then
- local item = dic.Cabbage
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 4
- elseif maf >= 98 and maf <= 99 then
- local item = dic.DragonFruit
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 5
- elseif maf >= 100 and maf <= 100 then
- local item = dic.BushsBakedBeans
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 6
- end
- elseif tier == 3 then
- local maf = math.random(1,100)
- if maf >= 1 and maf <= 15 then
- local item = dic.Apple
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 1
- elseif maf >= 16 and maf <= 40 then
- local item = dic.Orange
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 2
- elseif maf >= 41 and maf <= 80 then
- local item = dic.Blueberry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 3
- elseif maf >= 81 and maf <= 90 then
- local item = dic.Cabbage
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 4
- elseif maf >= 91 and maf <= 95 then
- local item = dic.DragonFruit
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 5
- elseif maf >= 96 and maf <= 98 then
- local item = dic.BushsBakedBeans
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 6
- elseif maf >= 99 and maf <= 100 then
- local item = dic.SnowBerry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 7
- end
- elseif tier == 4 then
- local maf = math.random(1,100)
- if maf >= 1 and maf <= 10 then
- local item = dic.Apple
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 1
- elseif maf >= 11 and maf <= 20 then
- local item = dic.Orange
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 2
- elseif maf >= 21 and maf <= 40 then
- local item = dic.Blueberry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 3
- elseif maf >= 41 and maf <= 80 then
- local item = dic.Cabbage
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 4
- elseif maf >= 81 and maf <= 90 then
- local item = dic.DragonFruit
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 5
- elseif maf >= 91 and maf <= 95 then
- local item = dic.BushsBakedBeans
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 6
- elseif maf >= 96 and maf <= 100 then
- local item = dic.SnowBerry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 7
- end
- elseif tier == 5 then
- local maf = math.random(1,100)
- if maf >= 1 and maf <= 3 then
- local item = dic.Apple
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 1
- elseif maf >= 4 and maf <= 6 then
- local item = dic.Orange
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 2
- elseif maf >= 7 and maf <= 14 then
- local item = dic.Blueberry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 3
- elseif maf >= 15 and maf <= 40 then
- local item = dic.Cabbage
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 4
- elseif maf >= 41 and maf <= 75 then
- local item = dic.DragonFruit
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 5
- elseif maf >= 76 and maf <= 88 then
- local item = dic.BushsBakedBeans
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 6
- elseif maf >= 89 and maf <= 100 then
- local item = dic.SnowBerry
- part.Size = item.Size
- part.Color = item.Color
- part.Material = item.Material
- data = 7
- end
- end
- if fs ~= nil then
- part.Position = fs.Position
- local click = Instance.new("ClickDetector",part)
- fruitcount = fruitcount + 1
- local pla
- click.MouseClick:Connect(function(plr)
- pla = plr
- fruitcount = fruitcount - 1
- if plr:FindFirstChild("GrowBrick") ~= nil then
- plr:FindFirstChild("GrowBrick"):FireClient(pla,"Pickup",data)
- part:Destroy()
- playSound(4056786383,1,1.6,pla.Character.Head,"Grab")
- end
- end)
- end
- end
- end
- end
- end
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while wait(5) do
- if Hunger > 0 then
- Hunger = Hunger - 1
- if StarvingAlert then
- StarvingAlert = false
- end
- else
- Health = Health - 2
- if not StarvingAlert then
- StarvingAlert = true
- remote:FireClient(Player,"starving")
- end
- Size = Size - (Size*.05)
- local rayorigin2 = brick.Position
- local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {brick}
- local ray = workspace:Raycast(
- rayorigin2,
- raydirection2,
- raycastParams
- )
- if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
- brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
- if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
- brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
- end
- end
- end
- if Health + 2 < 100 and Hunger > 0 then
- Health = Health + 2
- Hunger = Hunger - 1
- elseif Health < 100 and Hunger > 0 then
- Health = 100
- Hunger = Hunger - 1
- end
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- end
- end))
- function eat(part)
- local typ = part.Type.Value
- local sat = dic[items[typ]].Saturation
- local siz = (Size*2)/10
- local sat1 = sat*.75
- local color = Color3.fromRGB(math.floor(brick.Color.R*255),math.floor(brick.Color.G*255),math.floor(brick.Color.B*255))
- Hunger = Hunger + math.floor((sat1/(1+siz)))
- if Hunger > 100 then Hunger = 100 end
- local sat2 = sat*.005
- Size = Size + (sat2/(1+siz))
- BillboardGui.Size = UDim2.new(2*Size, 0, 1*Size, 0)
- BillboardGui.StudsOffset = Vector3.new(0, 1*Size, 0)
- local rayorigin2 = brick.Position
- local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {brick}
- local ray = workspace:Raycast(
- rayorigin2,
- raydirection2,
- raycastParams
- )
- if typ == 7 then
- Speed = Speed + 0.25
- elseif typ == 6 then
- Defecation = Defecation + 1
- end
- DefeTick = DefeTick - 2
- if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil then
- brick.Size = Vector3.new(0.5*Size,0.25*Size,0.5*Size)
- if brick ~= nil and brick.Parent ~= nil and brick.Position ~= nil and ray ~= nil and ray.Position ~= nil then
- brick.Position = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
- end
- end
- Speede = Speed * Size
- hunger.Text = "🍗 "..tostring(Hunger)
- health.Text = "💕"..tostring(Health)
- local rbies = math.floor(color.R*255)
- local gbies = math.floor(color.G*255)
- local bbies = math.floor(color.B*255)
- if typ == 1 then
- if rbies + 2 < 256 then
- rbies = rbies + 2
- else
- rbies = 255
- end
- if gbies - 1 > -1 then
- gbies = gbies - 1
- else
- gbies = 0
- end
- if bbies - 1 > -1 then
- bbies = bbies - 1
- else
- bbies = 0
- end
- elseif typ == 2 then
- if rbies + 2 < 256 then
- rbies = rbies + 2
- else
- rbies = 255
- end
- if gbies + 1 < 256 then
- gbies = gbies + 1
- else
- gbies = 255
- end
- if bbies - 1 > -1 then
- bbies = bbies - 1
- else
- bbies = 0
- end
- elseif typ == 3 then
- if rbies - 1 > -1 then
- rbies = rbies - 1
- else
- rbies = 0
- end
- if gbies - 1 > -1 then
- gbies = gbies - 1
- else
- gbies = 0
- end
- if bbies + 2 < 256 then
- bbies = bbies + 2
- else
- bbies = 255
- end
- elseif typ == 4 then
- if rbies - 1 > -1 then
- rbies = rbies - 1
- else
- rbies = 0
- end
- if gbies + 2 < 256 then
- gbies = gbies + 2
- else
- gbies = 255
- end
- if bbies - 1 > -1 then
- bbies = bbies - 1
- else
- bbies = 0
- end
- elseif typ == 5 then
- if rbies + 2 < 256 then
- rbies = rbies + 2
- else
- rbies = 255
- end
- if gbies - 1 > -1 then
- gbies = gbies - 1
- else
- gbies = 0
- end
- if bbies + 2 < 256 then
- bbies = bbies + 2
- else
- bbies = 255
- end
- elseif typ == 6 then
- if rbies - 2 > -1 then
- rbies = rbies - 2
- else
- rbies = 0
- end
- if gbies - 2 > -1 then
- gbies = gbies - 2
- else
- gbies = 0
- end
- if bbies - 2 > -1 then
- bbies = bbies - 2
- else
- bbies = 0
- end
- elseif typ == 7 then
- if rbies + 2 < 256 then
- rbies = rbies + 2
- else
- rbies = 255
- end
- if gbies + 2 < 256 then
- gbies = gbies + 2
- else
- gbies = 255
- end
- if bbies + 2 < 256 then
- bbies = bbies + 2
- else
- bbies = 255
- end
- elseif typ == 15 then
- if rbies + 20 < 256 then
- rbies = rbies + 20
- else
- rbies = 255
- end
- if gbies - 10 > -1 then
- gbies = gbies - 10
- else
- gbies = 0
- end
- if bbies - 10 > -1 then
- bbies = bbies - 10
- else
- bbies = 0
- end
- elseif typ == 16 then
- if rbies + 20 < 256 then
- rbies = rbies + 20
- else
- rbies = 255
- end
- if gbies + 10 < 256 then
- gbies = gbies + 10
- else
- gbies = 255
- end
- if bbies - 10 > -1 then
- bbies = bbies - 10
- else
- bbies = 0
- end
- elseif typ == 17 then
- if rbies - 10 > -1 then
- rbies = rbies - 10
- else
- rbies = 0
- end
- if gbies - 10 > -1 then
- gbies = gbies - 10
- else
- gbies = 0
- end
- if bbies + 20 < 256 then
- bbies = bbies + 20
- else
- bbies = 255
- end
- elseif typ == 18 then
- if rbies - 10 > -1 then
- rbies = rbies - 10
- else
- rbies = 0
- end
- if gbies + 20 < 256 then
- gbies = gbies + 20
- else
- gbies = 255
- end
- if bbies - 10 > -1 then
- bbies = bbies - 10
- else
- bbies = 0
- end
- elseif typ == 19 then
- if rbies + 20 < 256 then
- rbies = rbies + 20
- else
- rbies = 255
- end
- if gbies - 10 > -1 then
- gbies = gbies - 10
- else
- gbies = 0
- end
- if bbies + 20 < 256 then
- bbies = bbies + 20
- else
- bbies = 255
- end
- elseif typ == 20 then
- if rbies - 20 > -1 then
- rbies = rbies - 20
- else
- rbies = 0
- end
- if gbies - 20 > -1 then
- gbies = gbies - 20
- else
- gbies = 0
- end
- if bbies - 20 > -1 then
- bbies = bbies - 20
- else
- bbies = 0
- end
- elseif typ == 21 then
- if rbies + 20 < 256 then
- rbies = rbies + 20
- else
- rbies = 255
- end
- if gbies + 20 < 256 then
- gbies = gbies + 20
- else
- gbies = 255
- end
- if bbies + 20 < 256 then
- bbies = bbies + 20
- else
- bbies = 255
- end
- end
- R = rbies
- G = gbies
- B = bbies
- brick.Color = Color3.fromRGB(rbies,gbies,bbies)
- part:Destroy()
- end
- coroutine.resume(coroutine.create(function()
- while wait() do
- Position = brick.Position
- Rotation = brick.Orientation
- if not Following and Wandering and #FoodToEat == 0 then
- local ranx = math.random(-2*Size,2*Size)
- local ranz = math.random(-2*Size,2*Size)
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {brick}
- local rayorigin = Vector3.new(ranx,(brick.Size.Y/2)+brick.Size.Y/2,ranz)+brick.Position
- local raydirection = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local ray = workspace:Raycast(
- rayorigin,
- raydirection,
- raycastParams
- )
- local rayorigin2 = brick.Position
- local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local ray2 = workspace:Raycast(
- rayorigin2,
- raydirection2,
- raycastParams
- )
- if ray and ray2 and ray.Position.Y == ray2.Position.Y then
- local newpos = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z)
- local mag = (brick.Position - newpos).Magnitude
- local p = Instance.new("MeshPart")
- p.Transparency = 1
- p.CanCollide = false
- p.Anchored = true
- p.CFrame = CFrame.new(brick.Position,newpos)
- local goal = {}
- goal.Orientation = p.Orientation
- local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
- tween:Play()
- wait(0.5)
- local sped = 0.2*Speede
- local waittime = mag/sped
- local goal2 = {}
- goal2.Position = newpos
- if Size >= 10 then
- local pa = Instance.new("MeshPart",workspace)
- pa.Transparency = 1
- pa.CanCollide = false
- pa.Position = brick.Position+Vector3.new(0,brick.Size.Y,0)
- pa.Size = brick.Size
- pa.Anchored = true
- 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)))
- local tab = workspace:FindPartsInRegion3(region,pa)
- pa:Destroy()
- local checkedplayers = {}
- for i,v in pairs(tab) do
- if v ~= nil and v.Parent.ClassName == "Model" and v.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
- local plr = v.Parent
- if table.find(checkedplayers,plr) == nil and plr:FindFirstChild("HumanoidRootPart") ~= nil then
- table.insert(checkedplayers,plr)
- local offset = brick.Position - plr.HumanoidRootPart.Position
- local goal = {}
- goal.Position = Vector3.new(newpos.X,plr.HumanoidRootPart.Position.Y,newpos.Z) - Vector3.new(offset.X,0,offset.Z)
- plr.HumanoidRootPart.Anchored = true
- local g = TweenService:Create(plr.HumanoidRootPart, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal)
- g:Play()
- coroutine.resume(coroutine.create(function()
- wait(waittime)
- plr.HumanoidRootPart.Anchored = false
- end))
- end
- end
- end
- end
- local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
- tween:Play()
- Moving = true
- wait(waittime)
- Moving = false
- LastSafePosition = brick.Position
- Rotation = brick.Orientation
- Position = brick.Position
- end
- wait(math.random(1.0,7.0))
- elseif not Following and #FoodToEat > 0 then
- local part = FoodToEat[1]
- if part == nil or part.Parent == nil or part:FindFirstChild("Type") == nil then
- table.remove(FoodToEat,1)
- else
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {brick,part}
- local rayorigin = part.Position
- local raydirection = Vector3.new(0,(part.Size.Y+20)*-1,0)
- local ray = workspace:Raycast(
- rayorigin,
- raydirection,
- raycastParams
- )
- local rayorigin2 = brick.Position
- local raydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local ray2 = workspace:Raycast(
- rayorigin2,
- raydirection2,
- raycastParams
- )
- if ray and ray2 and ray.Position.Y == ray2.Position.Y then
- local vec
- local number = brick.Position.X-part.Position.X
- if number >= 0 then
- vec = Vector3.new((brick.Size.X/2)+part.Size.X/2,0,0)
- else
- vec = -Vector3.new((brick.Size.X/2)+part.Size.X/2,0,0)
- end
- local newpos = Vector3.new(ray.Position.X,ray.Position.Y+(brick.Size.Y/2),ray.Position.Z) + vec
- local p = Instance.new("MeshPart")
- p.Transparency = 1
- p.CanCollide = false
- p.Anchored = true
- p.CFrame = CFrame.new(brick.Position,newpos)
- local goal = {}
- goal.Orientation = p.Orientation
- local tween = TweenService:Create(brick, TweenInfo.new(0.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut),goal)
- tween:Play()
- wait(0.5)
- local mag = (ray.Position - ray2.Position).Magnitude
- local sped = 0.2*Speede
- local waittime = mag/sped
- local goal2 = {}
- goal2.Position = newpos
- if Size >= 10 then
- local pa = Instance.new("MeshPart",workspace)
- pa.Transparency = 1
- pa.CanCollide = false
- pa.Position = brick.Position+Vector3.new(0,brick.Size.Y,0)
- pa.Size = brick.Size
- pa.Anchored = true
- 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)))
- local tab = workspace:FindPartsInRegion3(region,pa)
- pa:Destroy()
- local checkedplayers = {}
- for i,v in pairs(tab) do
- if v ~= nil and v.Parent.ClassName == "Model" and v.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
- local plr = v.Parent
- if table.find(checkedplayers,plr) == nil and plr:FindFirstChild("HumanoidRootPart") ~= nil then
- table.insert(checkedplayers,plr)
- local offset = brick.Position - plr.HumanoidRootPart.Position
- local goal = {}
- goal.Position = Vector3.new(newpos.X,plr.HumanoidRootPart.Position.Y,newpos.Z) - Vector3.new(offset.X,0,offset.Z)
- plr.HumanoidRootPart.Anchored = true
- local g = TweenService:Create(plr.HumanoidRootPart, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal)
- g:Play()
- coroutine.resume(coroutine.create(function()
- wait(waittime)
- plr.HumanoidRootPart.Anchored = false
- end))
- end
- end
- end
- end
- local tween = TweenService:Create(brick, TweenInfo.new(waittime,Enum.EasingStyle.Linear),goal2)
- tween:Play()
- Moving = true
- wait(waittime)
- brick.BillboardGui.FoodBackground.FoodBar.BackgroundTransparency = 1
- brick.BillboardGui.FoodBackground.BackgroundTransparency = 1
- brick.BillboardGui.FoodBackground.FoodBar.Size = UDim2.new(0,0,1,0)
- local goal3 = {}
- goal3.BackgroundTransparency = 0.5
- local goal3a = {}
- goal3a.BackgroundTransparency = 0.5
- local tween1 = TweenService:Create(brick.BillboardGui.FoodBackground, TweenInfo.new(0.3,Enum.EasingStyle.Linear),goal3)
- local tween2 = TweenService:Create(brick.BillboardGui.FoodBackground.FoodBar, TweenInfo.new(0.3,Enum.EasingStyle.Linear),goal3a)
- tween1:Play()
- tween2:Play()
- wait(0.3)
- local sound = brick:FindFirstChild("Eating")
- if sound == nil then
- sound = Instance.new("Sound",brick)
- end
- sound.Name = "Eating"
- sound.SoundId = "rbxassetid://5841604328"
- sound.Volume = 0.4
- sound.Looped = true
- sound.Pitch = 1.25
- sound:Play()
- local bep = 0
- while bep < 1 do
- if bep + (0.041666666666667*(0.33333333333333+Size/3)) < 1 then
- bep = bep + (0.041666666666667*(0.33333333333333+Size/3))
- else
- bep = 1
- end
- if brick ~= nil and brick.Parent ~= nil then
- brick.BillboardGui.FoodBackground.FoodBar.Size = UDim2.new(bep,0,1,0)
- else
- break
- end
- wait(1/6)
- end
- sound:Stop()
- if part ~= nil and part.Parent ~= nil and part:FindFirstChild("Type") ~= nil then
- eat(part)
- end
- local goal5 = {}
- goal5.BackgroundTransparency = 1
- local goal5a = {}
- goal5a.BackgroundTransparency = 1
- local tween1 = TweenService:Create(brick.BillboardGui.FoodBackground, TweenInfo.new(0.5,Enum.EasingStyle.Linear),goal5)
- local tween2 = TweenService:Create(brick.BillboardGui.FoodBackground.FoodBar, TweenInfo.new(0.5,Enum.EasingStyle.Linear),goal5a)
- tween1:Play()
- tween2:Play()
- table.remove(FoodToEat,1)
- wait(math.random(0.33,0.65))
- else
- local part = FoodToEat[1]
- local data = part.Type.Value
- Player:FindFirstChild("GrowBrick"):FireClient(Player,"Pickup",data)
- part.Parent = nil
- table.remove(FoodToEat,1)
- end
- end
- elseif Following then
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {Player.Character,brick}
- local rayyorigin = Player.Character.Head.Position + Vector3.new(0,5,0)
- local rayydirection = Vector3.new(0,-100,0)
- local rayy = workspace:Raycast(
- rayyorigin,
- rayydirection,
- raycastParams
- )
- local rayyorigin2 = brick.Position
- local rayydirection2 = Vector3.new(0,(brick.Size.Y+20)*-1,0)
- local rayy2 = workspace:Raycast(
- rayyorigin2,
- rayydirection2,
- raycastParams
- )
- if rayy and rayy2 and rayy.Position.Y == rayy2.Position.Y and (rayy.Position-rayy2.Position).Magnitude > 1.25*Size and Boredom < 100 then
- moveForwards(rayy.Position)
- local cha = math.random(1,4)
- if cha == 1 then
- Boredom = Boredom + 1
- end
- elseif rayy and rayy2 and (rayy.Position-rayy2.Position).Magnitude <= 1.25*Size and Boredom < 100 then
- Boredom = Boredom + 1
- elseif Boredom >= 100 then
- Following = false
- Boredom = 0
- end
- wait()
- else
- wait(math.random(1.0,4.0))
- end
- end
- end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement