--[[ WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk! ]] local Client = require(game.Players.LocalPlayer.PlayerScripts.Client) local player = game.Players.LocalPlayer local config = { plantDelay = 1, plantAmount = 3, surroundBase = false, spiralBase = false, circleRadius = 45, skyBase = false, heartBase = false, pyramidBase = false, -- Added Pyramid Base } local SKY_HEIGHT = 50 -- Fixed height for Sky Base -- GUI setup local screenGui = Instance.new("ScreenGui") screenGui.Name = "SaplingPlanterUI" screenGui.ResetOnSpawn = false screenGui.Parent = player.PlayerGui -- Main frame local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 280, 0, 400) frame.Position = UDim2.new(0.5, -140, 0.5, -200) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 12) corner.Parent = frame -- Title local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 36) title.Position = UDim2.new(0, 0, 0, 0) title.BackgroundTransparency = 1 title.Text = "🌱 Infinite Saplings" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.TextSize = 20 title.Font = Enum.Font.GothamBold title.Parent = frame -- Owner Label local ownerLabel = Instance.new("TextLabel") ownerLabel.Size = UDim2.new(1, 0, 0, 24) ownerLabel.Position = UDim2.new(0, 0, 0, 36) ownerLabel.BackgroundTransparency = 1 ownerLabel.Text = "Owner: joshe454" ownerLabel.TextColor3 = Color3.fromRGB(255, 255, 255) ownerLabel.TextSize = 14 ownerLabel.Font = Enum.Font.Gotham ownerLabel.TextXAlignment = Enum.TextXAlignment.Center ownerLabel.Parent = frame -- Dragging Logic local dragging, dragInput, dragStart, startPos = false, nil, nil, nil local function update(input) local delta = input.Position - dragStart frame.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) game:GetService("UserInputService").InputChanged:Connect(function(input) if input == dragInput and dragging then update(input) end end) -- Scrolling frame local scroll = Instance.new("ScrollingFrame") scroll.Size = UDim2.new(1, 0, 1, -70) scroll.Position = UDim2.new(0, 0, 0, 36) scroll.BackgroundTransparency = 1 scroll.CanvasSize = UDim2.new(0,0,1.5,0) scroll.ScrollBarThickness = 6 scroll.Parent = frame -- GUI Utilities local function createToggle(name, posY, colorOff) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1,-20,0,32) btn.Position = UDim2.new(0,10,0,posY) btn.BackgroundColor3 = colorOff btn.Text = name .. ": OFF" btn.TextColor3 = Color3.fromRGB(255,255,255) btn.TextSize = 14 btn.Font = Enum.Font.GothamBold btn.Parent = scroll local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0,6) corner.Parent = btn return btn end local function createLabel(text,posY) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1,-20,0,22) lbl.Position = UDim2.new(0,10,0,posY) lbl.BackgroundTransparency = 1 lbl.Text = text lbl.TextColor3 = Color3.fromRGB(255,255,255) lbl.TextSize = 14 lbl.Font = Enum.Font.Gotham lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.Parent = scroll return lbl end local function createTextBox(text,posY,placeholder) local tb = Instance.new("TextBox") tb.Size = UDim2.new(1,-20,0,30) tb.Position = UDim2.new(0,10,0,posY) tb.BackgroundColor3 = Color3.fromRGB(50,50,50) tb.Text = text tb.TextColor3 = Color3.fromRGB(255,255,255) tb.TextSize = 14 tb.Font = Enum.Font.Gotham tb.PlaceholderText = placeholder tb.Parent = scroll local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0,6) corner.Parent = tb return tb end -- Input fields local delayLabel = createLabel("Plant Delay: 1s",10) local delayInput = createTextBox("1",32,"0-2 seconds") local amountLabel = createLabel("Plant Amount: 3",70) local amountInput = createTextBox("3",92,"1-1000") local radiusLabel = createLabel("Base Radius: 45",130) local radiusInput = createTextBox("45",152,"41-100 studs") -- Toggle buttons local surroundToggle = createToggle("Surround Base",190, Color3.fromRGB(60,60,60)) local spiralToggle = createToggle("Spiral Base",230, Color3.fromRGB(60,60,60)) local skyToggle = createToggle("Sky Base",270, Color3.fromRGB(60,60,60)) local heartToggle = createToggle("Heart Base",310, Color3.fromRGB(60,60,60)) local pyramidToggle = createToggle("Pyramid Base",350, Color3.fromRGB(60,60,60)) -- Added toggle -- Input handling delayInput.FocusLost:Connect(function() local v = tonumber(delayInput.Text) if v and v>=0 and v<=2 then config.plantDelay=v delayLabel.Text="Plant Delay: "..v.."s" else delayInput.Text=tostring(config.plantDelay) end end) amountInput.FocusLost:Connect(function() local v = tonumber(amountInput.Text) if v and v>=1 and v<=1000 then config.plantAmount = math.floor(v) amountLabel.Text = "Plant Amount: "..v else amountInput.Text=tostring(config.plantAmount) end end) radiusInput.FocusLost:Connect(function() local v = tonumber(radiusInput.Text) if v and v>=41 and v<=100 then config.circleRadius=v radiusLabel.Text="Base Radius: "..v else radiusInput.Text=tostring(config.circleRadius) end end) -- Toggle logic surroundToggle.MouseButton1Click:Connect(function() config.surroundBase = not config.surroundBase if config.surroundBase then surroundToggle.Text = "Surround Base: ON" surroundToggle.BackgroundColor3 = Color3.fromRGB(0,170,0) else surroundToggle.Text = "Surround Base: OFF" surroundToggle.BackgroundColor3 = Color3.fromRGB(60,60,60) end end) spiralToggle.MouseButton1Click:Connect(function() config.spiralBase = not config.spiralBase if config.spiralBase then spiralToggle.Text = "Spiral Base: ON" spiralToggle.BackgroundColor3 = Color3.fromRGB(255,120,0) else spiralToggle.Text = "Spiral Base: OFF" spiralToggle.BackgroundColor3 = Color3.fromRGB(60,60,60) end end) skyToggle.MouseButton1Click:Connect(function() config.skyBase = not config.skyBase if config.skyBase then skyToggle.Text = "Sky Base: ON" skyToggle.BackgroundColor3 = Color3.fromRGB(0,170,255) else skyToggle.Text = "Sky Base: OFF" skyToggle.BackgroundColor3 = Color3.fromRGB(60,60,60) end end) heartToggle.MouseButton1Click:Connect(function() config.heartBase = not config.heartBase if config.heartBase then heartToggle.Text = "Heart Base: ON" heartToggle.BackgroundColor3 = Color3.fromRGB(255,0,100) else heartToggle.Text = "Heart Base: OFF" heartToggle.BackgroundColor3 = Color3.fromRGB(60,60,60) end end) pyramidToggle.MouseButton1Click:Connect(function() config.pyramidBase = not config.pyramidBase if config.pyramidBase then pyramidToggle.Text = "Pyramid Base: ON" pyramidToggle.BackgroundColor3 = Color3.fromRGB(255,215,0) else pyramidToggle.Text = "Pyramid Base: OFF" pyramidToggle.BackgroundColor3 = Color3.fromRGB(60,60,60) end end) -- ==================== -- Base Generators & Planting -- ==================== local previewParts={} local function clearPreview() for _,p in ipairs(previewParts) do if p and p.Parent then p:Destroy() end end previewParts={} end local function findNearestSapling() local char = player.Character if not char or not char.PrimaryPart then return nil end local pos = char.PrimaryPart.Position local nearest, shortest = nil, math.huge for _,item in ipairs(workspace.Items:GetChildren()) do if item.Name=="Sapling" and item.PrimaryPart then local dist = (item.PrimaryPart.Position-pos).Magnitude if dist