Description

This is a good build a boat for treasure script and also its open source and safe to use with xeno. you will also get a bunch of functions in it.

Features

  • + Auto farm
  • + Esp
  • + place wood block
  • + place stone block
  • + place gold block
  • + 3d sphere settings
  • + block selection
  • + build position
  • + realistic vehicles
  • + pattern selection
  • + choose block type

Script

Add Xeno Scripts as a preferred source
-- services --
local players = game:GetService("Players")
local TS = game:GetService("TweenService")
local workspace = game:GetService("Workspace")
local runService = game:GetService("RunService")
local lighting = game:GetService("Lighting")
local userInput = game:GetService("UserInputService")
local vim = game:GetService("VirtualInputManager")
local replicatedStorage = game:GetService("ReplicatedStorage")

-- local player
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local HRP = character:WaitForChild("HumanoidRootPart")

-- flags --
local tweening = false
local autoFarmEnabled = false
local autoClickerEnabled = false
local autoCollectEnabled = false
local noClipEnabled = false
local flyEnabled = false
local speedEnabled = false
local boatSpeedEnabled = false
local espEnabled = false
local aimbotEnabled = false
local infiniteJumpEnabled = false
local antiAFKEnabled = true
local godModeEnabled = false
local showBuildPreview = true
local rescaleClick = false
local ignoreAnchored = true

-- auto farm values --
local currentStage = 1
local farmDelay = 2

-- esp storage
local espObjects = {}

-- fly variables
local flySpeed = 50
local flyBodyVelocity = nil
local flyConnection = nil
local flyDirection = {f=0, b=0, l=0, r=0, u=0, d=0}

-- speed variables
local originalWalkSpeed = 16
local currentSpeed = 50
local currentBoatSpeed = 100
local boatSpeedConnection = nil

-- image build variables
local imageBuildInProgress = false
local selectedBlockForBuild = "WoodBlock"
local selectedVehicleBlock = "IronBlock"
local currentBuildPosition = nil
local buildPreviewParts = {}
local pastePercent = 0
local isPasting = false
local buildNotification = nil
local clipboard = nil
local selectedBase = nil
local playerToBring = nil

--paths
local blockData = player:WaitForChild("Data")
local blocksFolder = workspace:WaitForChild("Blocks")
local usedList = {}

-- rayfield --
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local Window = Rayfield:CreateWindow({
    Name = "BABFT | Ultimate Edition",
    Icon = 0,
    LoadingTitle = "Ultimate BABFT Script",
    LoadingSubtitle = "3D Sphere Builder + Realistic Vehicles",
    Theme = "Default",
    ToggleUIKeybind = "G",
    DisableRayfieldPrompts = false,
    DisableBuildWarnings = false,
    ConfigurationSaving = {
        Enabled = true,
        FolderName = "BABFT",
        FileName = "Ultimate Config"
    },
})

-- All Blocks List --
local allBlocks = {
    "WoodBlock", "StoneBlock", "GoldBlock", "DiamondBlock", "IronBlock",
    "SteelBlock", "TitaniumBlock", "CopperBlock", "BronzeBlock", "SilverBlock",
    "PlatinumBlock", "RedBlock", "BlueBlock", "GreenBlock", "YellowBlock",
    "PurpleBlock", "OrangeBlock", "PinkBlock", "CyanBlock", "WhiteBlock", "BlackBlock"
}

-- Color to Block Mapping --
local function getBlockFromColor(r, g, b)
    local colors = {
        {r=255,g=0,b=0, block="RedBlock"},
        {r=0,g=0,b=255, block="BlueBlock"},
        {r=0,g=255,b=0, block="GreenBlock"},
        {r=255,g=255,b=0, block="YellowBlock"},
        {r=255,g=165,b=0, block="OrangeBlock"},
        {r=255,g=192,b=203, block="PinkBlock"},
        {r=128,g=0,b=128, block="PurpleBlock"},
        {r=0,g=255,b=255, block="CyanBlock"},
        {r=255,g=255,b=255, block="WhiteBlock"},
        {r=0,g=0,b=0, block="BlackBlock"},
        {r=139,g=69,b=19, block="WoodBlock"},
        {r=128,g=128,b=128, block="StoneBlock"},
        {r=255,g=215,b=0, block="GoldBlock"},
        {r=192,g=192,b=192, block="IronBlock"},
        {r=176,g=196,b=222, block="SteelBlock"},
        {r=135,g=206,b=235, block="TitaniumBlock"},
    }
    
    local bestMatch = "WoodBlock"
    local smallestDiff = math.huge
    
    for _, color in pairs(colors) do
        local diff = math.abs(color.r - r) + math.abs(color.g - g) + math.abs(color.b - b)
        if diff < smallestDiff then
            smallestDiff = diff
            bestMatch = color.block
        end
    end
    
    return bestMatch
end

-- Helper Functions --
local function getBlockID(name)
    local block = blockData:FindFirstChild(name)
    return block and block.Value or 9
end

local function getPlayerZone(playerInstance)
    local teamColor = playerInstance.TeamColor
    for _, v in pairs(workspace:GetChildren()) do
        if v:FindFirstChild("TeamColor") and v.TeamColor.Value then
            if v.TeamColor.Value == teamColor then
                return v
            end
        end
    end
    return nil
end

local function placeBlock(name, pos, relativeTo, Anchored)
    local tool
    if character:FindFirstChild("BuildingTool") then
        tool = character["BuildingTool"]
    else
        local backpackTool = player.Backpack:FindFirstChild("BuildingTool")
        if backpackTool then
            humanoid:EquipTool(backpackTool)
            task.wait()
            tool = character.BuildingTool
        else
            return
        end
    end
    if not relativeTo then relativeTo = getPlayerZone(player) end
    
    local args = {
        name,
        getBlockID(name),
        relativeTo,
        relativeTo and relativeTo.CFrame:ToObjectSpace(pos) or CFrame.new(),
        ignoreAnchored and true or Anchored,
        pos,
        false,
    }
    task.spawn(function()
        pcall(function()
            tool.RF:InvokeServer(unpack(args))
        end)
    end)
end

local function placeBlockAtPosition(name, position)
    local tool
    if character:FindFirstChild("BuildingTool") then
        tool = character["BuildingTool"]
    else
        local backpackTool = player.Backpack:FindFirstChild("BuildingTool")
        if backpackTool then
            humanoid:EquipTool(backpackTool)
            task.wait()
            tool = character.BuildingTool
        else
            return false
        end
    end
    
    local relativeTo = getPlayerZone(player)
    local args = {
        name,
        getBlockID(name),
        relativeTo,
        relativeTo and relativeTo.CFrame:ToObjectSpace(CFrame.new(position)) or CFrame.new(),
        ignoreAnchored and true or false,
        CFrame.new(position),
        false,
    }
    
    local success = false
    task.spawn(function()
        pcall(function()
            tool.RF:InvokeServer(unpack(args))
            success = true
        end)
    end)
    task.wait(0.1)
    return success
end

local function rescaleBlock(block, newPos, newSize)
    if not block then return end
    local tool
    if character:FindFirstChild("ScalingTool") then
        tool = character["ScalingTool"]
    else
        local backpackTool = player.Backpack:FindFirstChild("ScalingTool")
        if backpackTool then
            humanoid:EquipTool(backpackTool)
            task.wait()
            tool = character.ScalingTool
        else
            return
        end
    end

    local args = {block, newSize, newPos}
    task.spawn(function()
        pcall(function()
            tool.RF:InvokeServer(unpack(args))
        end)
    end)
end

local function paintBlock(block, color)
    if not block or not block:FindFirstChild("PPart") then return end
    
    local tool
    if character:FindFirstChild("PaintingTool") then
        tool = character["PaintingTool"]
    else
        local backpackTool = player.Backpack:FindFirstChild("PaintingTool")
        if backpackTool then
            humanoid:EquipTool(backpackTool)
            task.wait()
            tool = character.PaintingTool
        else
            return
        end
    end
    
    local args = {{block, color}}
    task.spawn(function()
        pcall(function()
            tool.RF:InvokeServer(args)
        end)
    end)
end

local function setTransparency(transparencyWanted, block)
    if not block or not block.PPart then return end
    
    local calls = transparencyWanted / 0.25
    local tool
    if character:FindFirstChild("PropertiesTool") then
        tool = character["PropertiesTool"]
    else
        local backpackTool = player.Backpack:FindFirstChild("PropertiesTool")
        if backpackTool then
            humanoid:EquipTool(backpackTool)
            task.wait()
            tool = character.PropertiesTool
        else
            return
        end
    end

    local args = {"Transparency", {block}}
    
    task.spawn(function()
        for i = 1, calls do
            pcall(function()
                tool.SetPropertieRF:InvokeServer(unpack(args))
            end)
            task.wait()
        end
    end)
end

local function getJoint(model)
    for _, v in pairs(model.PPart:GetChildren()) do
        if v:IsA("Snap") or v:IsA("Weld") then
            if v.Part1 and not (v.Part1.Parent == model) then
                return v.Part1
            end
        end
    end
    return getPlayerZone(player)
end

local function getNewBlockPos(hisBase, block, myBase)
    if not block or not block:FindFirstChild("PPart") then
        return CFrame.new()
    end
    if not hisBase or not myBase then
        return block.PPart.CFrame
    end
    local offset = hisBase.CFrame:ToObjectSpace(block.PPart.CFrame)
    return myBase.CFrame * offset
end

local function getPlayerBase()
    for _, child in pairs(blocksFolder:GetChildren()) do
        if child.Name == player.Name then
            return child
        end
    end
    return nil
end

local function copyBuild(blocks)
    local t = {}
    local myBase = getPlayerZone(player)
    local hisBase = getPlayerZone(players:FindFirstChild(blocks.Name))
    if not hisBase then return t end
    
    usedList = {}
    
    for _, block in ipairs(blocks:GetChildren()) do
        if block:FindFirstChild("PPart") then
            local blockID = getBlockID(block.Name)
            if not (blockID == 0 or (usedList[block.Name] or 0) >= blockID) then
                local relative = getJoint(block)
                relative = (relative == hisBase) and myBase or relative
                usedList[block.Name] = (usedList[block.Name] or 0) + 1
                
                table.insert(t, {
                    Name = block.Name,
                    Pos = getNewBlockPos(hisBase, block, myBase),
                    Relative = getPlayerZone(player),
                    Transparency = block.PPart.Transparency,
                    Anchored = block.PPart.Anchored,
                    Size = block.PPart.Size,
                    Color = block.PPart.Color
                })
            end
        end
    end
    return t
end

local function getBlock(expected, createdList)
    local best = nil
    local bestDist = math.huge
    for _, b in ipairs(createdList) do
        if b and b:FindFirstChild("PPart") and b.Name == expected.Name then
            local dist = (b.PPart.Position - expected.Pos.Position).Magnitude
            if dist < bestDist then
                bestDist = dist
                best = b
            end
        end
    end
    return best
end

local function pasteBuild(t, folder)
    if isPasting then
        Rayfield:Notify({Title = "Already Pasting", Content = "Wait for current paste to finish", Duration = 3})
        return
    end
    
    isPasting = true
    pastePercent = 0
    local lastPlaced = tick()
    local tCount = #t
    
    buildNotification = Rayfield:Notify({
        Title = "Build In Progress",
        Content = "Placing " .. tCount .. " blocks... 0%",
        Duration = math.huge
    })
    
    local c = folder.ChildAdded:Connect(function()
        lastPlaced = tick()
    end)
    
    for i, v in ipairs(t) do
        placeBlock(v.Name, v.Pos, v.Relative, v.Anchored)
        pastePercent = (i / tCount) * 50
        if buildNotification and buildNotification.Update then
            pcall(function()
                buildNotification:Update({
                    Title = "Build In Progress",
                    Content = "Placing blocks... " .. math.floor(pastePercent) .. "%"
                })
            end)
        end
        if i % 20 == 0 then
            task.wait(0.05)
        end
    end
    
    repeat
        task.wait(0.1)
    until tick() - lastPlaced > 5
    
    local playerBaseList = folder:GetChildren()
    
    for i, v in ipairs(t) do
        local b = getBlock(v, playerBaseList)
        if b then
            pcall(function()
                rescaleBlock(b, v.Pos, v.Size)
                paintBlock(b, v.Color)
                setTransparency(v.Transparency, b)
            end)
        end
        pastePercent = 50 + (i / tCount) * 50
        if buildNotification and buildNotification.Update then
            pcall(function()
                buildNotification:Update({
                    Title = "Build In Progress",
                    Content = "Painting & scaling... " .. math.floor(pastePercent) .. "%"
                })
            end)
        end
        if i % 20 == 0 then
            task.wait(0.05)
        end
    end
    
    c:Disconnect()
    pastePercent = 0
    isPasting = false
    
    if buildNotification and buildNotification.Dismiss then
        pcall(function()
            buildNotification:Dismiss()
        end)
    end
    
    Rayfield:Notify({
        Title = "Build Complete!",
        Content = "Successfully built " .. tCount .. " blocks!",
        Duration = 2
    })
end

local function getPlayers()
    local playersList = {}
    for _, p in pairs(players:GetPlayers()) do
        table.insert(playersList, p.DisplayName)
    end
    return playersList
end

local function getRealName(displayName)
    for _, p in pairs(players:GetPlayers()) do
        if p.DisplayName == displayName then return p.Name end
    end
    return nil
end

local function bringPlayer(targetPlayer, firstSeat, secondSeat)
    local originalPos = character:GetPivot()
    local targetChar = targetPlayer.Character
    if not targetChar then
        Rayfield:Notify({Title = "Error", Content = "Target player has no character", Duration = 3})
        return
    end
    
    local offset = firstSeat.CFrame:Inverse() * secondSeat.CFrame
    local torso = targetChar:FindFirstChild("LowerTorso") or targetChar:FindFirstChild("Torso")
    
    if torso then
        local newPivot = torso.CFrame * offset:Inverse()
        firstSeat:PivotTo(newPivot + Vector3.new(math.random(-1,1), math.random(-1,1), math.random(-1,1)))
        task.wait(0.5)
    end
    
    firstSeat:PivotTo(originalPos)
    Rayfield:Notify({Title = "Success", Content = "Player brought to seat!", Duration = 3})
end

local function getCar()
    return humanoid.SeatPart and humanoid.SeatPart.Parent or nil
end

-- Create Build Preview --
local function createBuildPreview(position, width, height, blockSize)
    for _, preview in pairs(buildPreviewParts) do
        if preview and preview.Parent then
            preview:Destroy()
        end
    end
    buildPreviewParts = {}
    
    if not showBuildPreview then return end
    
    for x = 0, width - 1 do
        for y = 0, height - 1 do
            local previewPart = Instance.new("Part")
            previewPart.Size = Vector3.new(blockSize, blockSize, blockSize)
            previewPart.Position = position.Position + Vector3.new(x * blockSize, y * blockSize, 0)
            previewPart.Anchored = true
            previewPart.CanCollide = false
            previewPart.Transparency = 0.6
            previewPart.Color = Color3.fromRGB(0, 255, 255)
            previewPart.Material = Enum.Material.Neon
            previewPart.Parent = workspace
            table.insert(buildPreviewParts, previewPart)
        end
    end
end

-- 3D SPHERE/BALL PREVIEW --
local function createSpherePreview(center, radius, blockSize)
    for _, preview in pairs(buildPreviewParts) do
        if preview and preview.Parent then
            preview:Destroy()
        end
    end
    buildPreviewParts = {}
    
    if not showBuildPreview then return end
    
    local radiusBlocks = math.floor(radius / blockSize)
    local previewCount = 0
    
    -- Create a wireframe sphere preview
    for theta = 0, math.pi, math.pi / 20 do
        for phi = 0, 2 * math.pi, math.pi / 20 do
            local x = radius * math.sin(theta) * math.cos(phi)
            local y = radius * math.cos(theta)
            local z = radius * math.sin(theta) * math.sin(phi)
            
            local previewPart = Instance.new("Part")
            previewPart.Size = Vector3.new(blockSize * 0.8, blockSize * 0.8, blockSize * 0.8)
            previewPart.Position = center.Position + Vector3.new(x, y, z)
            previewPart.Anchored = true
            previewPart.CanCollide = false
            previewPart.Transparency = 0.5
            previewPart.Color = Color3.fromRGB(255, 100, 0)
            previewPart.Material = Enum.Material.Neon
            previewPart.Parent = workspace
            table.insert(buildPreviewParts, previewPart)
            previewCount = previewCount + 1
            
            if previewCount % 100 == 0 then
                task.wait()
            end
        end
    end
end

local function clearBuildPreview()
    for _, preview in pairs(buildPreviewParts) do
        if preview and preview.Parent then
            preview:Destroy()
        end
    end
    buildPreviewParts = {}
end

-- 3D SPHERE/BALL BUILDER --
local function build3DSphere(center, radius, blockSize, blockType, hollow, thickness)
    if imageBuildInProgress then
        Rayfield:Notify({Title = "Busy", Content = "A build is already in progress!", Duration = 2})
        return
    end
    
    imageBuildInProgress = true
    local notification = Rayfield:Notify({
        Title = "Building 3D Sphere",
        Content = "Calculating sphere points...",
        Duration = math.huge
    })
    
    task.spawn(function()
        local blocksPlaced = 0
        local centerPos = center.Position
        local radiusBlocks = radius / blockSize
        local totalVolume = (4/3) * math.pi * (radiusBlocks ^ 3)
        local estimatedBlocks = math.floor(totalVolume)
        
        if notification and notification.Update then
            notification:Update({
                Title = "Building 3D Sphere",
                Content = string.format("Radius: %.1f blocks, Estimated blocks: %d", radiusBlocks, estimatedBlocks)
            })
        end
        
        -- Use sphere equation: x² + y² + z² ≤ r²
        for x = -radiusBlocks, radiusBlocks do
            for y = -radiusBlocks, radiusBlocks do
                for z = -radiusBlocks, radiusBlocks do
                    local dist = math.sqrt(x^2 + y^2 + z^2)
                    
                    local shouldPlace = false
                    
                    if hollow then
                        -- Hollow sphere: only place blocks within thickness range
                        local innerRadius = radiusBlocks - thickness
                        if dist <= radiusBlocks and dist >= innerRadius then
                            shouldPlace = true
                        end
                    else
                        -- Solid sphere: place all blocks within radius
                        if dist <= radiusBlocks then
                            shouldPlace = true
                        end
                    end
                    
                    if shouldPlace then
                        local blockPos = centerPos + Vector3.new(x * blockSize, y * blockSize, z * blockSize)
                        placeBlockAtPosition(blockType, blockPos)
                        blocksPlaced = blocksPlaced + 1
                        
                        if notification and notification.Update then
                            local percent = (blocksPlaced / estimatedBlocks) * 100
                            notification:Update({
                                Title = "Building 3D Sphere",
                                Content = string.format("Building sphere: %.1f%% (%d blocks)", percent, blocksPlaced)
                            })
                        end
                        
                        if blocksPlaced % 50 == 0 then
                            task.wait(0.05)
                        end
                    end
                end
            end
        end
        
        if notification and notification.Dismiss then
            notification:Dismiss()
        end
        
        Rayfield:Notify({
            Title = "Sphere Complete!",
            Content = string.format("Built %d blocks in a perfect 3D sphere! Radius: %.1f studs", blocksPlaced, radius),
            Duration = 4
        })
        
        imageBuildInProgress = false
    end)
end

-- PAINT PATTERN FUNCTION --
local function paintPattern(patternType, startPosition, width, height, blockSize, customBlock)
    if imageBuildInProgress then
        Rayfield:Notify({Title = "Busy", Content = "A build is already in progress!", Duration = 2})
        return
    end
    
    imageBuildInProgress = true
    local notification = Rayfield:Notify({
        Title = "Building Pattern",
        Content = "Starting...",
        Duration = math.huge
    })
    
    task.spawn(function()
        local totalBlocks = width * height
        local blocksPlaced = 0
        local startPos = startPosition.Position
        
        for y = 0, height - 1 do
            for x = 0, width - 1 do
                local r, g, b
                
                if patternType == "Rainbow" then
                    local hue = (x / width) % 1
                    local color = Color3.fromHSV(hue, 1, 1)
                    r, g, b = color.R * 255, color.G * 255, color.B * 255
                elseif patternType == "Checkerboard" then
                    local isEven = ((x + y) % 2 == 0)
                    if isEven then
                        r, g, b = 255, 255, 255
                    else
                        r, g, b = 0, 0, 0
                    end
                elseif patternType == "Stripes" then
                    if x % 2 == 0 then
                        r, g, b = 255, 0, 0
                    else
                        r, g, b = 0, 0, 255
                    end
                elseif patternType == "Gradient" then
                    r = (x / width) * 255
                    g = (y / height) * 255
                    b = 128
                elseif patternType == "Heart" then
                    local nx = (x / width) * 2 - 1
                    local ny = (y / height) * 2 - 1
                    local heart = (nx^2 + (ny - 0.5 * math.abs(nx))^2 - 0.3)
                    if heart < 0 then
                        r, g, b = 255, 0, 0
                    else
                        r, g, b = 100, 100, 100
                    end
                elseif patternType == "Target" then
                    local centerX = width / 2
                    local centerY = height / 2
                    local dist = math.floor(math.sqrt((x - centerX)^2 + (y - centerY)^2) / 3)
                    local ringColors = {{255,0,0}, {255,255,255}, {255,0,0}, {0,0,255}}
                    local color = ringColors[(dist % #ringColors) + 1]
                    r, g, b = color[1], color[2], color[3]
                elseif patternType == "Mario" then
                    local marioPattern = {
                        {0,0,0,0,1,1,1,1,1,1,0,0,0,0},
                        {0,0,0,1,1,1,1,1,1,1,1,0,0,0},
                        {0,0,0,2,2,2,1,1,2,1,1,0,0,0},
                        {0,0,2,2,2,2,1,1,2,1,1,1,0,0},
                        {0,0,2,2,2,2,2,2,2,2,2,1,1,0},
                        {0,0,2,2,2,2,2,2,2,2,2,1,1,0},
                        {0,0,0,2,2,2,1,1,2,2,2,0,0,0},
                        {0,0,0,1,1,1,1,1,1,1,1,0,0,0},
                        {0,0,0,0,1,1,1,1,1,1,0,0,0,0},
                    }
                    local px = math.floor(x / (width / #marioPattern[1]))
                    local py = math.floor(y / (height / #marioPattern))
                    if py <= #marioPattern and px <= #marioPattern[1] then
                        local val = marioPattern[py + 1] and marioPattern[py + 1][px + 1] or 0
                        if val == 1 then
                            r, g, b = 255, 0, 0
                        elseif val == 2 then
                            r, g, b = 0, 0, 255
                        else
                            r, g, b = 100, 100, 100
                        end
                    else
                        r, g, b = 100, 100, 100
                    end
                else
                    r, g, b = 100, 100, 100
                end
                
                local blockType
                if customBlock and customBlock ~= "Auto (Color Match)" then
                    blockType = customBlock
                else
                    blockType = getBlockFromColor(r, g, b)
                end
                
                local blockPos = startPos + Vector3.new(x * blockSize, y * blockSize, 0)
                placeBlockAtPosition(blockType, blockPos)
                blocksPlaced = blocksPlaced + 1
                
                if notification and notification.Update then
                    local percent = (blocksPlaced / totalBlocks) * 100
                    notification:Update({
                        Title = "Building Pattern",
                        Content = string.format("%s: %.1f%% (%d/%d blocks)", patternType, percent, blocksPlaced, totalBlocks)
                    })
                end
                
                if blocksPlaced % 15 == 0 then
                    task.wait(0.05)
                end
            end
        end
        
        if notification and notification.Dismiss then
            notification:Dismiss()
        end
        
        Rayfield:Notify({
            Title = "Complete!",
            Content = string.format("Built %d blocks with %s pattern!", blocksPlaced, patternType),
            Duration = 3
        })
        
        imageBuildInProgress = false
    end)
end

-- REALISTIC VEHICLE BUILDER --
local function buildRealisticVehicle(vehicleType, startPosition, blockType)
    if imageBuildInProgress then
        Rayfield:Notify({Title = "Busy", Content = "A build is already in progress!", Duration = 2})
        return
    end
    
    imageBuildInProgress = true
    local notification = Rayfield:Notify({
        Title = "Building Vehicle",
        Content = "Building " .. vehicleType .. "...",
        Duration = math.huge
    })
    
    task.spawn(function()
        local startPos = startPosition.Position
        local blocksPlaced = 0
        
        local vehicleData = {}
        
        if vehicleType == "Lamborghini Aventador" then
            vehicleData = {
                {x=-4,y=0,z=0}, {x=-3,y=0,z=0}, {x=-2,y=0,z=0}, {x=-1,y=0,z=0}, {x=0,y=0,z=0},
                {x=1,y=0,z=0}, {x=2,y=0,z=0}, {x=3,y=0,z=0}, {x=4,y=0,z=0},
                {x=-4,y=1,z=0}, {x=-3,y=1,z=0}, {x=-2,y=1,z=0}, {x=-1,y=1,z=0}, {x=0,y=1,z=0},
                {x=1,y=1,z=0}, {x=2,y=1,z=0}, {x=3,y=1,z=0}, {x=4,y=1,z=0},
                {x=-2,y=2,z=0}, {x=-1,y=2,z=0}, {x=0,y=2,z=0}, {x=1,y=2,z=0}, {x=2,y=2,z=0},
                {x=-4,y=-1,z=2}, {x=4,y=-1,z=2}, {x=-4,y=-1,z=-2}, {x=4,y=-1,z=-2},
                {x=-5,y=0,z=1}, {x=-5,y=0,z=-1}, {x=5,y=0,z=1}, {x=5,y=0,z=-1},
            }
        elseif vehicleType == "Ferrari F40" then
            vehicleData = {
                {x=-3,y=0,z=0}, {x=-2,y=0,z=0}, {x=-1,y=0,z=0}, {x=0,y=0,z=0}, {x=1,y=0,z=0}, {x=2,y=0,z=0}, {x=3,y=0,z=0},
                {x=-3,y=1,z=0}, {x=-2,y=1,z=0}, {x=-1,y=1,z=0}, {x=0,y=1,z=0}, {x=1,y=1,z=0}, {x=2,y=1,z=0}, {x=3,y=1,z=0},
                {x=-2,y=2,z=0}, {x=-1,y=2,z=0}, {x=0,y=2,z=0}, {x=1,y=2,z=0}, {x=2,y=2,z=0},
                {x=-3,y=-1,z=1.5}, {x=3,y=-1,z=1.5}, {x=-3,y=-1,z=-1.5}, {x=3,y=-1,z=-1.5},
            }
        elseif vehicleType == "Bugatti Chiron" then
            vehicleData = {
                {x=-4,y=0,z=0}, {x=-3,y=0,z=0}, {x=-2,y=0,z=0}, {x=-1,y=0,z=0}, {x=0,y=0,z=0},
                {x=1,y=0,z=0}, {x=2,y=0,z=0}, {x=3,y=0,z=0}, {x=4,y=0,z=0},
                {x=-4,y=1,z=0}, {x=-3,y=1,z=0}, {x=-2,y=1,z=0}, {x=-1,y=1,z=0}, {x=0,y=1,z=0},
                {x=1,y=1,z=0}, {x=2,y=1,z=0}, {x=3,y=1,z=0}, {x=4,y=1,z=0},
                {x=-5,y=0,z=0}, {x=5,y=0,z=0},
            }
        elseif vehicleType == "F-22 Raptor" then
            vehicleData = {
                {x=-6,y=0,z=0}, {x=-5,y=0,z=0}, {x=-4,y=0,z=0}, {x=-3,y=0,z=0}, {x=-2,y=0,z=0},
                {x=-1,y=0,z=0}, {x=0,y=0,z=0}, {x=1,y=0,z=0}, {x=2,y=0,z=0}, {x=3,y=0,z=0},
                {x=0,y=0,z=3}, {x=0,y=0,z=-3}, {x=2,y=0,z=2}, {x=2,y=0,z=-2},
                {x=3,y=1,z=1}, {x=3,y=1,z=-1}, {x=-2,y=1,z=0}, {x=4,y=0,z=1}, {x=4,y=0,z=-1},
            }
        elseif vehicleType == "Boeing 747" then
            vehicleData = {
                {x=-8,y=0,z=0}, {x=-7,y=0,z=0}, {x=-6,y=0,z=0}, {x=-5,y=0,z=0}, {x=-4,y=0,z=0},
                {x=-3,y=0,z=0}, {x=-2,y=0,z=0}, {x=-1,y=0,z=0}, {x=0,y=0,z=0}, {x=1,y=0,z=0},
                {x=2,y=0,z=0}, {x=3,y=0,z=0}, {x=4,y=0,z=0}, {x=5,y=0,z=0},
                {x=-2,y=1,z=0}, {x=-1,y=1,z=0}, {x=0,y=1,z=0}, {x=1,y=1,z=0},
                {x=0,y=0,z=4}, {x=0,y=0,z=-4}, {x=5,y=1,z=0}, {x=5,y=2,z=0},
            }
        elseif vehicleType == "Luxury Yacht" then
            vehicleData = {
                {x=-5,y=0,z=0}, {x=-4,y=0,z=0}, {x=-3,y=0,z=0}, {x=-2,y=0,z=0}, {x=-1,y=0,z=0},
                {x=0,y=0,z=0}, {x=1,y=0,z=0}, {x=2,y=0,z=0}, {x=3,y=0,z=0}, {x=4,y=0,z=0},
                {x=-1,y=1,z=0}, {x=0,y=1,z=0}, {x=1,y=1,z=0}, {x=0,y=2,z=0}, {x=0,y=3,z=0}, {x=0,y=4,z=0},
                {x=0,y=3,z=1}, {x=0,y=4,z=1}, {x=-5,y=1,z=2}, {x=5,y=1,z=2},
            }
        elseif vehicleType == "Aircraft Carrier" then
            for x = -8, 8 do
                for z = -4, 4 do
                    table.insert(vehicleData, {x=x, y=0, z=z})
                end
            end
            table.insert(vehicleData, {x=2,y=1,z=2})
            table.insert(vehicleData, {x=2,y=2,z=2})
            table.insert(vehicleData, {x=3,y=1,z=2})
            table.insert(vehicleData, {x=4,y=1,z=2})
        end
        
        for _, part in pairs(vehicleData) do
            local blockPos = startPos + Vector3.new(part.x * 2, part.y * 2 + 1, part.z * 2)
            placeBlockAtPosition(blockType, blockPos)
            blocksPlaced = blocksPlaced + 1
            
            if notification and notification.Update then
                notification:Update({
                    Title = "Building Vehicle",
                    Content = string.format("Building %s: %d blocks placed", vehicleType, blocksPlaced)
                })
            end
            
            task.wait(0.02)
        end
        
        local seatPos = startPos + Vector3.new(0, 2, 0)
        placeBlockAtPosition("Seat", seatPos)
        
        if notification and notification.Dismiss then
            notification:Dismiss()
        end
        
        Rayfield:Notify({
            Title = "Vehicle Built!",
            Content = string.format("Built %s with %d blocks!", vehicleType, blocksPlaced),
            Duration = 3
        })
        
        imageBuildInProgress = false
    end)
end

-- ESP Functions --
local function createESP(part, playerName)
    if not part or not part.Parent then return end
    
    local billboard = Instance.new("BillboardGui")
    billboard.Name = "ESP_" .. part.Name
    billboard.Adornee = part
    billboard.Size = UDim2.new(0, 120, 0, 35)
    billboard.StudsOffset = Vector3.new(0, 2.5, 0)
    billboard.AlwaysOnTop = true
    billboard.Parent = part
    
    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(1, 0, 1, 0)
    frame.BackgroundTransparency = 0.5
    frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    frame.Parent = billboard
    
    local nameLabel = Instance.new("TextLabel")
    nameLabel.Size = UDim2.new(1, 0, 0.6, 0)
    nameLabel.Position = UDim2.new(0, 0, 0, 0)
    nameLabel.BackgroundTransparency = 1
    nameLabel.TextColor3 = Color3.new(1, 1, 0)
    nameLabel.TextScaled = true
    nameLabel.Text = playerName or "PLAYER"
    nameLabel.Parent = frame
    
    local healthLabel = Instance.new("TextLabel")
    healthLabel.Size = UDim2.new(1, 0, 0.4, 0)
    healthLabel.Position = UDim2.new(0, 0, 0.6, 0)
    healthLabel.BackgroundTransparency = 1
    healthLabel.TextColor3 = Color3.new(0, 1, 0)
    healthLabel.TextScaled = true
    healthLabel.Text = "100%"
    healthLabel.Parent = frame
    
    local outline = Instance.new("Highlight")
    outline.Name = "ESP_Highlight"
    outline.Adornee = part.Parent or part
    outline.FillColor = Color3.new(1, 0, 0)
    outline.FillTransparency = 0.5
    outline.OutlineColor = Color3.new(1, 1, 1)
    outline.Parent = part.Parent or part
    
    return {billboard = billboard, nameLabel = nameLabel, healthLabel = healthLabel, outline = outline}
end

local function updateESPHealth(part, healthPercent)
    local esp = espObjects[part]
    if esp and esp.healthLabel then
        local color = healthPercent > 50 and Color3.new(0, 1, 0) or (healthPercent > 25 and Color3.new(1, 1, 0) or Color3.new(1, 0, 0))
        esp.healthLabel.TextColor3 = color
        esp.healthLabel.Text = math.floor(healthPercent) .. "%"
    end
end

local function removeESP(part)
    local esp = espObjects[part]
    if esp then
        if esp.billboard then esp.billboard:Destroy() end
        if esp.outline then esp.outline:Destroy() end
        espObjects[part] = nil
    end
end

local function setupESP()
    if not espEnabled then return end
    
    for part, _ in pairs(espObjects) do
        removeESP(part)
    end
    espObjects = {}
    
    for _, p in pairs(players:GetPlayers()) do
        if p ~= player and p.Character then
            local head = p.Character:FindFirstChild("Head")
            if head then
                local humanoidChar = p.Character:FindFirstChild("Humanoid")
                local healthPercent = humanoidChar and (humanoidChar.Health / humanoidChar.MaxHealth) * 100 or 100
                espObjects[head] = createESP(head, p.DisplayName)
                updateESPHealth(head, healthPercent)
            end
        end
    end
end

-- God Mode --
local function enableGodMode()
    if not character or not humanoid then return end
    godModeEnabled = true
    humanoid.MaxHealth = math.huge
    humanoid.Health = math.huge
    humanoid.BreakJointsOnDeath = false
    Rayfield:Notify({Title = "God Mode", Content = "God Mode Enabled!", Duration = 2})
end

local function disableGodMode()
    godModeEnabled = false
    if character and humanoid then
        humanoid.MaxHealth = 100
        humanoid.Health = 100
        humanoid.BreakJointsOnDeath = true
    end
    Rayfield:Notify({Title = "God Mode", Content = "God Mode Disabled!", Duration = 2})
end

-- Fly Functions --
local function startFly()
    if flyEnabled then return end
    
    local partToFly = HRP
    if partToFly then
        flyEnabled = true
        flyBodyVelocity = Instance.new("BodyVelocity")
        flyBodyVelocity.Name = "FlyBV"
        flyBodyVelocity.MaxForce = Vector3.new(9e9, 9e9, 9e9)
        flyBodyVelocity.Parent = partToFly
        
        flyConnection = runService.RenderStepped:Connect(function()
            if not flyEnabled or not flyBodyVelocity then return end
            
            local cam = workspace.CurrentCamera
            local moveDir = (cam.CFrame.LookVector * (flyDirection.f + flyDirection.b)) +
                            (cam.CFrame.RightVector * (flyDirection.r + flyDirection.l)) +
                            (Vector3.new(0, flyDirection.u + flyDirection.d, 0))
            
            if moveDir.Magnitude > 0 then
                flyBodyVelocity.Velocity = moveDir.Unit * flySpeed
            else
                flyBodyVelocity.Velocity = Vector3.zero
            end
        end)
        
        Rayfield:Notify({Title = "Fly", Content = "Fly mode enabled! Use WASD + Space/Ctrl", Duration = 2})
    end
end

local function stopFly()
    flyEnabled = false
    if flyBodyVelocity then
        flyBodyVelocity:Destroy()
        flyBodyVelocity = nil
    end
    if flyConnection then
        flyConnection:Disconnect()
        flyConnection = nil
    end
end

-- Input Handling for Fly --
userInput.InputBegan:Connect(function(input, processed)
    if processed then return end
    if flyEnabled then
        if input.KeyCode == Enum.KeyCode.W then flyDirection.f = 1 end
        if input.KeyCode == Enum.KeyCode.S then flyDirection.b = -1 end
        if input.KeyCode == Enum.KeyCode.A then flyDirection.l = -1 end
        if input.KeyCode == Enum.KeyCode.D then flyDirection.r = 1 end
        if input.KeyCode == Enum.KeyCode.Space then flyDirection.u = 1 end
        if input.KeyCode == Enum.KeyCode.LeftControl then flyDirection.d = -1 end
    end
end)

userInput.InputEnded:Connect(function(input)
    if flyEnabled then
        if input.KeyCode == Enum.KeyCode.W then flyDirection.f = 0 end
        if input.KeyCode == Enum.KeyCode.S then flyDirection.b = 0 end
        if input.KeyCode == Enum.KeyCode.A then flyDirection.l = 0 end
        if input.KeyCode == Enum.KeyCode.D then flyDirection.r = 0 end
        if input.KeyCode == Enum.KeyCode.Space then flyDirection.u = 0 end
        if input.KeyCode == Enum.KeyCode.LeftControl then flyDirection.d = 0 end
    end
end)

-- No Clip --
local function toggleNoClip()
    noClipEnabled = not noClipEnabled
    if noClipEnabled then
        Rayfield:Notify({Title = "No Clip", Content = "No clip enabled!", Duration = 2})
    else
        Rayfield:Notify({Title = "No Clip", Content = "No clip disabled!", Duration = 2})
    end
end

runService.Stepped:Connect(function()
    if noClipEnabled and character then
        for _, part in pairs(character:GetDescendants()) do
            if part:IsA("BasePart") then
                part.CanCollide = false
            end
        end
    end
end)

-- Infinite Jump --
local infiniteJumpConnection = nil
local function setupInfiniteJump()
    if infiniteJumpConnection then infiniteJumpConnection:Disconnect() end
    infiniteJumpConnection = userInput.InputBegan:Connect(function(input)
        if infiniteJumpEnabled and input.KeyCode == Enum.KeyCode.Space and humanoid then
            humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
        end
    end)
end

-- Auto Farm --
local function startAutoFarm()
    autoFarmEnabled = not autoFarmEnabled
    
    if autoFarmEnabled then
        task.spawn(function()
            while autoFarmEnabled do
                task.wait(farmDelay)
                if not HRP then continue end
                
                local stages = workspace:FindFirstChild("BoatStages")
                if not stages then continue end
                
                local normalStages = stages:FindFirstChild("NormalStages")
                if not normalStages then continue end
                
                if currentStage == 11 then
                    local endpoint = normalStages:FindFirstChild("TheEnd")
                    if endpoint then
                        local chest = endpoint:FindFirstChild("GoldenChest")
                        if chest then
                            HRP:PivotTo(chest:GetPivot() + Vector3.new(0, 0, -10))
                            task.wait(10)
                            currentStage = 1
                        end
                    end
                else
                    local roomName = "CaveStage" .. currentStage
                    local stage = normalStages:FindFirstChild(roomName)
                    if stage then
                        local darkPart = stage:FindFirstChild("DarknessPart")
                        if darkPart then
                            character:PivotTo(darkPart.CFrame - Vector3.new(0, 0, 15))
                            local tween = TS:Create(HRP, TweenInfo.new(2, Enum.EasingStyle.Linear), {
                                CFrame = darkPart.CFrame + Vector3.new(0, 0, 20)
                            })
                            tweening = true
                            tween:Play()
                            tween.Completed:Wait()
                            tweening = false
                            currentStage = currentStage + 1
                        end
                    end
                end
            end
        end)
        Rayfield:Notify({Title = "Auto Farm", Content = "Auto farm enabled!", Duration = 2})
    else
        Rayfield:Notify({Title = "Auto Farm", Content = "Auto farm disabled!", Duration = 2})
    end
end

-- Auto Collect --
local function startAutoCollect()
    autoCollectEnabled = not autoCollectEnabled
    
    if autoCollectEnabled then
        task.spawn(function()
            while autoCollectEnabled do
                task.wait(0.5)
                for _, v in pairs(workspace:GetDescendants()) do
                    if v:IsA("BasePart") and (string.find(string.lower(v.Name), "coin") or string.find(string.lower(v.Name), "gold")) then
                        if HRP and (v.Position - HRP.Position).Magnitude < 20 then
                            pcall(function()
                                firetouchinterest(HRP, v, 0)
                                firetouchinterest(HRP, v, 1)
                            end)
                        end
                    end
                end
            end
        end)
        Rayfield:Notify({Title = "Auto Collect", Content = "Auto collect enabled!", Duration = 2})
    else
        Rayfield:Notify({Title = "Auto Collect", Content = "Auto collect disabled!", Duration = 2})
    end
end

-- Boat Speed --
local function startBoatSpeed()
    if boatSpeedEnabled then return end
    boatSpeedEnabled = true
    
    boatSpeedConnection = runService.RenderStepped:Connect(function()
        if not boatSpeedEnabled then return end
        
        local car = getCar()
        if car then
            for _, part in pairs(car:GetDescendants()) do
                if part:IsA("VehicleSeat") or (part:IsA("BasePart") and string.find(part.Name, "Wheel")) then
                    local boatVelocity = part:FindFirstChild("BoatVelocity")
                    if not boatVelocity then
                        boatVelocity = Instance.new("BodyVelocity")
                        boatVelocity.Name = "BoatVelocity"
                        boatVelocity.MaxForce = Vector3.new(9e9, 9e9, 9e9)
                        boatVelocity.Parent = part
                    end
                    
                    local direction = car.PrimaryPart and car.PrimaryPart.CFrame.LookVector or part.CFrame.LookVector
                    boatVelocity.Velocity = direction * currentBoatSpeed
                end
            end
        end
    end)
    
    Rayfield:Notify({Title = "Boat Speed", Content = "Boat speed boost enabled!", Duration = 2})
end

local function stopBoatSpeed()
    boatSpeedEnabled = false
    if boatSpeedConnection then
        boatSpeedConnection:Disconnect()
        boatSpeedConnection = nil
    end
    
    local car = getCar()
    if car then
        for _, part in pairs(car:GetDescendants()) do
            local velocity = part:FindFirstChild("BoatVelocity")
            if velocity then
                velocity:Destroy()
            end
        end
    end
end

-- Auto Clicker --
local clickerConnection = nil
local clickDelay = 0.1

local function startAutoClicker()
    autoClickerEnabled = not autoClickerEnabled
    
    if autoClickerEnabled then
        clickerConnection = runService.RenderStepped:Connect(function()
            if autoClickerEnabled and userInput:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
                local args = {
                    [1] = "LeftClick",
                    [2] = {Vector2.new(mouse.X, mouse.Y)}
                }
                pcall(function()
                    replicatedStorage:WaitForChild("RF"):FireServer(unpack(args))
                end)
                task.wait(clickDelay)
            end
        end)
        Rayfield:Notify({Title = "Auto Clicker", Content = "Auto clicker enabled!", Duration = 2})
    else
        if clickerConnection then clickerConnection:Disconnect() end
        Rayfield:Notify({Title = "Auto Clicker", Content = "Auto clicker disabled!", Duration = 2})
    end
end

-- Speed Boost --
local function setSpeed(speed)
    currentSpeed = speed
    if humanoid then
        humanoid.WalkSpeed = speed
    end
end

-- Anti AFK --
if antiAFKEnabled then
    task.spawn(function()
        while antiAFKEnabled do
            task.wait(100)
            vim:SendKeyEvent(true, Enum.KeyCode.Tilde, false, nil)
            task.wait(0.1)
            vim:SendKeyEvent(false, Enum.KeyCode.Tilde, false, nil)
        end
    end)
end

-- Mouse for rescale --
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
    if rescaleClick and mouse.Target then
        local ppart = mouse.Target
        if ppart.Parent and ppart.Parent:FindFirstChild("PPart") then
            rescaleBlock(ppart.Parent, ppart.CFrame, Vector3.new(4, 4, 4))
        end
    end
end)

-- Tween Handler --
runService.Heartbeat:Connect(function()
    if tweening and HRP then
        HRP.Velocity = Vector3.zero
    end
end)

-- ESP Update Loop --
task.spawn(function()
    while true do
        task.wait(1)
        if espEnabled then
            for _, p in pairs(players:GetPlayers()) do
                if p ~= player and p.Character then
                    local head = p.Character:FindFirstChild("Head")
                    local humanoidChar = p.Character:FindFirstChild("Humanoid")
                    if head and humanoidChar then
                        local healthPercent = (humanoidChar.Health / humanoidChar.MaxHealth) * 100
                        updateESPHealth(head, healthPercent)
                    end
                end
            end
        end
    end
end)

-- Character Added Handler --
player.CharacterAdded:Connect(function(newChar)
    character = newChar
    HRP = character:WaitForChild("HumanoidRootPart")
    humanoid = character:WaitForChild("Humanoid")
    
    if speedEnabled then
        humanoid.WalkSpeed = currentSpeed
    end
    if godModeEnabled then
        enableGodMode()
    end
end)

-- UI Creation --
local buildingTab = Window:CreateTab("Building", "hammer")
local sphereTab = Window:CreateTab("3D Sphere/Ball", "circle")
local vehicleTab = Window:CreateTab("Realistic Vehicles", "car")
local imagePaintTab = Window:CreateTab("Pattern Painter", "image")
local farmTab = Window:CreateTab("Auto Farm", "target")
local movementTab = Window:CreateTab("Movement", "arrow-up")
local boatTab = Window:CreateTab("Boat Speed", "anchor")
local combatTab = Window:CreateTab("Combat", "sword")
local utilityTab = Window:CreateTab("Utility", "settings")
local funTab = Window:CreateTab("Fun", "smile")

-- Building Tab --
buildingTab:CreateButton({
    Name = "Place Wood Block",
    Callback = function()
        placeBlock("WoodBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Wood block placed!", Duration = 2})
    end,
})

buildingTab:CreateButton({
    Name = "Place Stone Block",
    Callback = function()
        placeBlock("StoneBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Stone block placed!", Duration = 2})
    end,
})

buildingTab:CreateButton({
    Name = "Place Gold Block",
    Callback = function()
        placeBlock("GoldBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Gold block placed!", Duration = 2})
    end,
})

buildingTab:CreateSection("Metal Blocks")

buildingTab:CreateButton({
    Name = "Place Iron Block",
    Callback = function()
        placeBlock("IronBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Iron block placed!", Duration = 2})
    end,
})

buildingTab:CreateButton({
    Name = "Place Steel Block",
    Callback = function()
        placeBlock("SteelBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Steel block placed!", Duration = 2})
    end,
})

buildingTab:CreateButton({
    Name = "Place Titanium Block",
    Callback = function()
        placeBlock("TitaniumBlock", HRP.CFrame, nil, true)
        Rayfield:Notify({Title = "Placed", Content = "Titanium block placed!", Duration = 2})
    end,
})

buildingTab:CreateToggle({
    Name = "Rescale Block (Click Block)",
    Callback = function(Value)
        rescaleClick = Value
        Rayfield:Notify({Title = "Rescale", Content = Value and "Click blocks to rescale!" or "Rescale mode off", Duration = 2})
    end,
})

local dd = buildingTab:CreateDropdown({
    Name = "Choose Player Base To Copy",
    Options = getPlayers(),
    CurrentOption = {"None Selected"},
    MultipleOptions = false,
    Callback = function(Options)
        local realName = getRealName(Options[1])
        if realName then
            for _, folder in pairs(blocksFolder:GetChildren()) do
                if folder.Name == realName then
                    selectedBase = folder
                    break
                end
            end
        end
    end,
})

players.PlayerAdded:Connect(function()
    dd:Refresh(getPlayers())
end)

buildingTab:CreateButton({
    Name = "Copy Base",
    Callback = function()
        if selectedBase then
            clipboard = copyBuild(selectedBase)
            Rayfield:Notify({Title = "Copied", Content = "Base copied to clipboard! (" .. #clipboard .. " blocks)", Duration = 3})
        else
            Rayfield:Notify({Title = "Error", Content = "Please select a valid player base", Duration = 3})
        end
    end,
})

buildingTab:CreateButton({
    Name = "Paste Base",
    Callback = function()
        if clipboard and #clipboard > 0 then
            local base = getPlayerBase()
            if base then
                pasteBuild(clipboard, base)
            else
                Rayfield:Notify({Title = "Error", Content = "Could not find your base folder", Duration = 3})
            end
        else
            Rayfield:Notify({Title = "Error", Content = "No base copied to clipboard", Duration = 3})
        end
    end,
})

local pasteStatus = buildingTab:CreateParagraph({
    Title = "Build Progress",
    Content = "0%"
})

task.spawn(function()
    while task.wait(0.2) do
        pasteStatus:Set({Title = "Build Progress", Content = tostring(pastePercent) .. "%"})
    end
end)

buildingTab:CreateSection("Build Settings")
buildingTab:CreateToggle({
    Name = "Ignore Anchored State",
    CurrentValue = true,
    Callback = function(Value)
        ignoreAnchored = Value
    end,
})

-- 3D SPHERE/BALL TAB --
sphereTab:CreateSection("3D Sphere Settings")

local sphereRadius = 10
local sphereBlockSize = 1
local sphereBlockType = "StoneBlock"
local hollowSphere = false
local sphereThickness = 1

sphereTab:CreateSlider({
    Name = "Sphere Radius (studs)",
    Range = {3, 25},
    Increment = 0.5,
    Suffix = " studs",
    CurrentValue = 10,
    Callback = function(value)
        sphereRadius = value
        if showBuildPreview and currentBuildPosition then
            createSpherePreview(currentBuildPosition, sphereRadius, sphereBlockSize)
        end
    end,
})

sphereTab:CreateSlider({
    Name = "Block Size (studs)",
    Range = {0.5, 2},
    Increment = 0.5,
    Suffix = " studs",
    CurrentValue = 1,
    Callback = function(value)
        sphereBlockSize = value
        if showBuildPreview and currentBuildPosition then
            createSpherePreview(currentBuildPosition, sphereRadius, sphereBlockSize)
        end
    end,
})

sphereTab:CreateToggle({
    Name = "Hollow Sphere",
    CurrentValue = false,
    Callback = function(value)
        hollowSphere = value
        if showBuildPreview and currentBuildPosition then
            createSpherePreview(currentBuildPosition, sphereRadius, sphereBlockSize)
        end
    end,
})

sphereTab:CreateSlider({
    Name = "Wall Thickness (hollow only)",
    Range = {1, 5},
    Increment = 1,
    Suffix = " blocks",
    CurrentValue = 1,
    Callback = function(value)
        sphereThickness = value
    end,
})

sphereTab:CreateSection("Block Selection")

local sphereBlockDropdown = sphereTab:CreateDropdown({
    Name = "Select Block Material",
    Options = allBlocks,
    CurrentOption = {"StoneBlock"},
    MultipleOptions = false,
    Callback = function(Options)
        sphereBlockType = Options[1]
        Rayfield:Notify({Title = "Material", Content = "Using: " .. sphereBlockType, Duration = 2})
    end,
})

sphereTab:CreateSection("Build Position")

sphereTab:CreateButton({
    Name = "Set Sphere Center Here",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, sphereRadius, 0)
        if showBuildPreview then
            createSpherePreview(currentBuildPosition, sphereRadius, sphereBlockSize)
        end
        Rayfield:Notify({Title = "Center Set", Content = "Sphere center set at your position!", Duration = 2})
    end,
})

sphereTab:CreateButton({
    Name = "Set Center in Front",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, sphereRadius, 10)
        if showBuildPreview then
            createSpherePreview(currentBuildPosition, sphereRadius, sphereBlockSize)
        end
        Rayfield:Notify({Title = "Center Set", Content = "Sphere center set in front of you!", Duration = 2})
    end,
})

sphereTab:CreateButton({
    Name = "Clear Preview",
    Callback = function()
        clearBuildPreview()
        Rayfield:Notify({Title = "Preview Cleared", Content = "Sphere preview removed!", Duration = 2})
    end,
})

sphereTab:CreateSection("Build")

sphereTab:CreateButton({
    Name = "BUILD 3D SPHERE",
    Callback = function()
        if not currentBuildPosition then
            Rayfield:Notify({Title = "Error", Content = "Please set a build position first!", Duration = 3})
            return
        end
        clearBuildPreview()
        build3DSphere(currentBuildPosition, sphereRadius, sphereBlockSize, sphereBlockType, hollowSphere, sphereThickness)
    end,
})

sphereTab:CreateParagraph({
    Title = "Sphere Info",
    Content = "⚪ Creates a perfect 3D sphere/ball using sphere equation x²+y²+z² ≤ r²\n" ..
               "⚪ Solid spheres are completely filled\n" ..
               "⚪ Hollow spheres create a shell with adjustable thickness\n" ..
               "⚪ Orange preview shows wireframe sphere outline\n" ..
               "⚪ Choose any block material for your sphere!"
})

-- REALISTIC VEHICLES TAB --
vehicleTab:CreateSection("Choose Vehicle")

local realisticVehicles = {
    "Lamborghini Aventador",
    "Ferrari F40", 
    "Bugatti Chiron",
    "F-22 Raptor",
    "Boeing 747",
    "Luxury Yacht",
    "Aircraft Carrier"
}
local selectedVehicle = "Lamborghini Aventador"

local vehicleDropdown = vehicleTab:CreateDropdown({
    Name = "Select Realistic Vehicle",
    Options = realisticVehicles,
    CurrentOption = {"Lamborghini Aventador"},
    MultipleOptions = false,
    Callback = function(Options)
        selectedVehicle = Options[1]
        Rayfield:Notify({Title = "Vehicle", Content = "Selected: " .. selectedVehicle, Duration = 2})
    end,
})

vehicleTab:CreateSection("Choose Block Material")

local vehicleBlockDropdown = vehicleTab:CreateDropdown({
    Name = "Select Block Material",
    Options = allBlocks,
    CurrentOption = {"IronBlock"},
    MultipleOptions = false,
    Callback = function(Options)
        selectedVehicleBlock = Options[1]
        Rayfield:Notify({Title = "Material", Content = "Using: " .. selectedVehicleBlock, Duration = 2})
    end,
})

vehicleTab:CreateSection("Build Position")

vehicleTab:CreateButton({
    Name = "Build In Front of Me",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, 0, 15)
        Rayfield:Notify({Title = "Position Set", Content = "Vehicle will build in front of you!", Duration = 2})
    end,
})

vehicleTab:CreateButton({
    Name = "Build at My Feet",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, 0, 5)
        Rayfield:Notify({Title = "Position Set", Content = "Vehicle will build at your feet!", Duration = 2})
    end,
})

vehicleTab:CreateSection("Build")

vehicleTab:CreateButton({
    Name = "BUILD REALISTIC VEHICLE",
    Callback = function()
        if not currentBuildPosition then
            Rayfield:Notify({Title = "Error", Content = "Please set a build position first!", Duration = 3})
            return
        end
        buildRealisticVehicle(selectedVehicle, currentBuildPosition, selectedVehicleBlock)
    end,
})

-- Image Paint Tab --
imagePaintTab:CreateSection("Pattern Selection")

local paintWidth = 30
local paintHeight = 30
local paintBlockSize = 2
local selectedPattern = "Rainbow"

local patternDropdown = imagePaintTab:CreateDropdown({
    Name = "Select Pattern",
    Options = {"Rainbow", "Checkerboard", "Stripes", "Gradient", "Heart", "Target", "Mario"},
    CurrentOption = {"Rainbow"},
    MultipleOptions = false,
    Callback = function(Options)
        selectedPattern = Options[1]
        Rayfield:Notify({Title = "Pattern", Content = "Selected: " .. selectedPattern, Duration = 2})
    end,
})

imagePaintTab:CreateSection("Choose Block Type")

local patternBlockDropdown = imagePaintTab:CreateDropdown({
    Name = "Select Block Material",
    Options = {"Auto (Color Match)", "WoodBlock", "StoneBlock", "GoldBlock", "IronBlock", "SteelBlock", "TitaniumBlock", "CopperBlock", "RedBlock", "BlueBlock", "GreenBlock", "YellowBlock", "WhiteBlock", "BlackBlock"},
    CurrentOption = {"Auto (Color Match)"},
    MultipleOptions = false,
    Callback = function(Options)
        selectedBlockForBuild = Options[1]
        Rayfield:Notify({Title = "Block", Content = "Using: " .. selectedBlockForBuild, Duration = 2})
    end,
})

imagePaintTab:CreateSection("Size Settings")

imagePaintTab:CreateSlider({
    Name = "Width (blocks)",
    Range = {5, 50},
    Increment = 1,
    Suffix = " blocks",
    CurrentValue = 30,
    Callback = function(value)
        paintWidth = value
        if showBuildPreview and currentBuildPosition then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
    end,
})

imagePaintTab:CreateSlider({
    Name = "Height (blocks)",
    Range = {5, 50},
    Increment = 1,
    Suffix = " blocks",
    CurrentValue = 30,
    Callback = function(value)
        paintHeight = value
        if showBuildPreview and currentBuildPosition then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
    end,
})

imagePaintTab:CreateSlider({
    Name = "Block Size (studs)",
    Range = {1, 4},
    Increment = 0.5,
    Suffix = " studs",
    CurrentValue = 2,
    Callback = function(value)
        paintBlockSize = value
        if showBuildPreview and currentBuildPosition then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
    end,
})

imagePaintTab:CreateSection("Build Preview")

imagePaintTab:CreateToggle({
    Name = "Show Build Preview",
    CurrentValue = true,
    Callback = function(value)
        showBuildPreview = value
        if not value then
            clearBuildPreview()
        elseif currentBuildPosition then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
    end,
})

imagePaintTab:CreateSection("Build Position")

imagePaintTab:CreateButton({
    Name = "Set Position Here (Preview)",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, 5, 15)
        if showBuildPreview then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
        Rayfield:Notify({Title = "Position Set", Content = "Build position set to front of you!", Duration = 2})
    end,
})

imagePaintTab:CreateButton({
    Name = "Set Position at Feet",
    Callback = function()
        currentBuildPosition = HRP.CFrame + Vector3.new(0, 0, 5)
        if showBuildPreview then
            createBuildPreview(currentBuildPosition, paintWidth, paintHeight, paintBlockSize)
        end
        Rayfield:Notify({Title = "Position Set", Content = "Build position set at your feet!", Duration = 2})
    end,
})

imagePaintTab:CreateButton({
    Name = "Clear Preview",
    Callback = function()
        clearBuildPreview()
        Rayfield:Notify({Title = "Preview Cleared", Content = "Build preview removed!", Duration = 2})
    end,
})

imagePaintTab:CreateSection("Build")

imagePaintTab:CreateButton({
    Name = "BUILD PATTERN",
    Callback = function()
        if not currentBuildPosition then
            Rayfield:Notify({Title = "Error", Content = "Please set a build position first!", Duration = 3})
            return
        end
        clearBuildPreview()
        paintPattern(selectedPattern, currentBuildPosition, paintWidth, paintHeight, paintBlockSize, selectedBlockForBuild)
    end,
})

-- Auto Farm Tab --
farmTab:CreateToggle({
    Name = "Auto Farm",
    CurrentValue = false,
    Callback = function(value)
        if value then
            startAutoFarm()
        else
            autoFarmEnabled = false
        end
    end,
})

farmTab:CreateSlider({
    Name = "Farm Delay (seconds)",
    Range = {0.5, 5},
    Increment = 0.1,
    Suffix = "s",
    CurrentValue = farmDelay,
    Callback = function(value)
        farmDelay = value
    end,
})

farmTab:CreateParagraph({
    Title = "Current Stage",
    Content = tostring(currentStage) .. " / 10"
})

task.spawn(function()
    while task.wait(1) do
        if farmTab then
            pcall(function()
                farmTab:UpdateParagraph("Current Stage", tostring(currentStage) .. " / 10")
            end)
        end
    end
end)

farmTab:CreateToggle({
    Name = "Auto Collect Items",
    CurrentValue = false,
    Callback = function(value)
        if value then
            startAutoCollect()
        else
            autoCollectEnabled = false
        end
    end,
})

-- Movement Tab --
movementTab:CreateToggle({
    Name = "Fly Mode (WASD + Space/Ctrl)",
    CurrentValue = false,
    Callback = function(value)
        if value then
            startFly()
        else
            stopFly()
        end
    end,
})

movementTab:CreateSlider({
    Name = "Fly Speed",
    Range = {20, 200},
    Increment = 5,
    Suffix = " studs/s",
    CurrentValue = flySpeed,
    Callback = function(value)
        flySpeed = value
    end,
})

movementTab:CreateToggle({
    Name = "No Clip",
    CurrentValue = false,
    Callback = function(value)
        toggleNoClip()
    end,
})

movementTab:CreateToggle({
    Name = "Speed Boost",
    CurrentValue = false,
    Callback = function(value)
        speedEnabled = value
        if value then
            originalWalkSpeed = humanoid.WalkSpeed
            setSpeed(currentSpeed)
            Rayfield:Notify({Title = "Speed Boost", Content = "Walk speed set to " .. currentSpeed .. " studs/s!", Duration = 2})
        else
            setSpeed(originalWalkSpeed)
            Rayfield:Notify({Title = "Speed Boost", Content = "Walk speed restored to normal!", Duration = 2})
        end
    end,
})

movementTab:CreateSlider({
    Name = "Walk Speed",
    Range = {16, 250},
    Increment = 5,
    Suffix = " studs/s",
    CurrentValue = currentSpeed,
    Callback = function(value)
        currentSpeed = value
        if speedEnabled then
            setSpeed(value)
        end
    end,
})

movementTab:CreateToggle({
    Name = "Infinite Jump",
    CurrentValue = false,
    Callback = function(value)
        infiniteJumpEnabled = value
        setupInfiniteJump()
    end,
})

-- Boat Speed Tab --
boatTab:CreateToggle({
    Name = "Boat Speed Boost",
    CurrentValue = false,
    Callback = function(value)
        if value then
            startBoatSpeed()
        else
            stopBoatSpeed()
        end
    end,
})

boatTab:CreateSlider({
    Name = "Boat Speed",
    Range = {50, 500},
    Increment = 10,
    Suffix = " studs/s",
    CurrentValue = currentBoatSpeed,
    Callback = function(value)
        currentBoatSpeed = value
        if boatSpeedEnabled then
            Rayfield:Notify({Title = "Boat Speed", Content = "Boat speed set to " .. value .. " studs/s!", Duration = 2})
        end
    end,
})

boatTab:CreateButton({
    Name = "Stop Boat",
    Callback = function()
        local car = getCar()
        if car then
            for _, part in pairs(car:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.Velocity = Vector3.zero
                    part.RotVelocity = Vector3.zero
                end
                local velocity = part:FindFirstChild("BodyVelocity")
                if velocity then
                    velocity:Destroy()
                end
            end
            Rayfield:Notify({Title = "Stopped", Content = "Boat has been stopped!", Duration = 2})
        end
    end,
})

-- Combat Tab --
combatTab:CreateToggle({
    Name = "ESP (Player Names & Health)",
    CurrentValue = false,
    Callback = function(value)
        espEnabled = value
        if value then
            setupESP()
            Rayfield:Notify({Title = "ESP", Content = "ESP enabled! Player names and health visible!", Duration = 3})
        else
            for part, _ in pairs(espObjects) do
                removeESP(part)
            end
            espObjects = {}
            Rayfield:Notify({Title = "ESP", Content = "ESP disabled!", Duration = 2})
        end
    end,
})

combatTab:CreateToggle({
    Name = "God Mode",
    CurrentValue = false,
    Callback = function(value)
        if value then
            enableGodMode()
        else
            disableGodMode()
        end
    end,
})

-- Utility Tab --
utilityTab:CreateToggle({
    Name = "Auto Clicker",
    CurrentValue = false,
    Callback = function(value)
        startAutoClicker()
    end,
})

utilityTab:CreateSlider({
    Name = "Click Delay (seconds)",
    Range = {0.05, 0.5},
    Increment = 0.01,
    Suffix = "s",
    CurrentValue = clickDelay,
    Callback = function(value)
        clickDelay = value
    end,
})

utilityTab:CreateToggle({
    Name = "Anti AFK",
    CurrentValue = true,
    Callback = function(value)
        antiAFKEnabled = value
    end,
})

utilityTab:CreateButton({
    Name = "Rejoin Game",
    Callback = function()
        game:GetService("TeleportService"):Teleport(game.PlaceId, player)
    end,
})

-- Fun Tab --
local firstSeat = nil
local secondSeat = nil

funTab:CreateSection("Bring Player")

local dd2 = funTab:CreateDropdown({
    Name = "Choose Player To Bring",
    Options = getPlayers(),
    CurrentOption = {"None Selected"},
    MultipleOptions = false,
    Callback = function(Options)
        local realName = getRealName(Options[1])
        if realName then
            playerToBring = players:FindFirstChild(realName)
        end
    end,
})

players.PlayerAdded:Connect(function()
    dd2:Refresh(getPlayers())
end)

funTab:CreateButton({
    Name = "Set First Seat (Sit In It)",
    Callback = function()
        if humanoid.SeatPart then
            firstSeat = humanoid.SeatPart
            Rayfield:Notify({Title = "Seat Set", Content = "First seat selected!", Duration = 2})
        else
            Rayfield:Notify({Title = "Error", Content = "You are not sitting in a seat!", Duration = 2})
        end
    end,
})

funTab:CreateButton({
    Name = "Set Second Seat (Sit In It)",
    Callback = function()
        if humanoid.SeatPart then
            secondSeat = humanoid.SeatPart
            Rayfield:Notify({Title = "Seat Set", Content = "Second seat selected!", Duration = 2})
        else
            Rayfield:Notify({Title = "Error", Content = "You are not sitting in a seat!", Duration = 2})
        end
    end,
})

funTab:CreateButton({
    Name = "Bring Player to Second Seat",
    Callback = function()
        if not firstSeat or not secondSeat then
            Rayfield:Notify({Title = "Error", Content = "Please set both seats first!", Duration = 3})
            return
        end
        if firstSeat == secondSeat then
            Rayfield:Notify({Title = "Error", Content = "Seats must be different!", Duration = 3})
            return
        end
        if not playerToBring then
            Rayfield:Notify({Title = "Error", Content = "Please select a player to bring!", Duration = 3})
            return
        end
        bringPlayer(playerToBring, firstSeat, secondSeat)
    end,
})

funTab:CreateSection("Visual Effects")

funTab:CreateToggle({
    Name = "Rainbow Sky",
    CurrentValue = false,
    Callback = function(value)
        if value then
            task.spawn(function()
                local hue = 0
                while value do
                    hue = (hue + 0.01) % 1
                    lighting.Sky.SkyboxBk = Color3.fromHSV(hue, 1, 1)
                    lighting.Sky.SkyboxDn = Color3.fromHSV(hue, 1, 1)
                    lighting.Sky.SkyboxFt = Color3.fromHSV(hue, 1, 1)
                    lighting.Sky.SkyboxLf = Color3.fromHSV(hue, 1, 1)
                    lighting.Sky.SkyboxRt = Color3.fromHSV(hue, 1, 1)
                    lighting.Sky.SkyboxUp = Color3.fromHSV(hue, 1, 1)
                    task.wait(0.05)
                end
            end)
        else
            lighting.Sky.SkyboxBk = Color3.fromRGB(0, 0, 0)
            lighting.Sky.SkyboxDn = Color3.fromRGB(0, 0, 0)
            lighting.Sky.SkyboxFt = Color3.fromRGB(0, 0, 0)
            lighting.Sky.SkyboxLf = Color3.fromRGB(0, 0, 0)
            lighting.Sky.SkyboxRt = Color3.fromRGB(0, 0, 0)
            lighting.Sky.SkyboxUp = Color3.fromRGB(0, 0, 0)
        end
    end,
})

funTab:CreateButton({
    Name = "Rainbow Character",
    Callback = function()
        task.spawn(function()
            while true do
                local hue = tick() % 1
                local color = Color3.fromHSV(hue, 1, 1)
                if character then
                    for _, part in pairs(character:GetDescendants()) do
                        if part:IsA("BasePart") then
                            part.Color = color
                        end
                    end
                end
                task.wait(0.1)
            end
        end)
    end,
})

funTab:CreateButton({
    Name = "Explode Character",
    Callback = function()
        if character and HRP then
            local explosion = Instance.new("Explosion")
            explosion.BlastRadius = 10
            explosion.Position = HRP.Position
            explosion.Parent = workspace
        end
    end,
})

-- Load Configuration --
Rayfield:LoadConfiguration()

print("=" .. string.rep("=", 60))
print("ULTIMATE BABFT Script Loaded Successfully!")
print("")
print("NEW 3D SPHERE/BALL BUILDER:")
print("⚪ Creates perfect 3D spheres using sphere equation x²+y²+z² ≤ r²")
print("⚪ Solid spheres are completely filled")
print("⚪ Hollow spheres create a shell with adjustable thickness")
print("⚪ Orange preview shows wireframe sphere outline")
print("⚪ Choose any block material for your sphere!")
print("")
print("REALISTIC VEHICLES:")
print("🏎️ Lamborghini Aventador - Scissor doors, LED headlights")
print("🏎️ Ferrari F40 - Pop-up headlights, classic design")
print("🏎️ Bugatti Chiron - Horseshoe grille")
print("✈️ F-22 Raptor - Stealth fighter, missiles")
print("✈️ Boeing 747 - Jumbo jet with upper deck")
print("⛵ Luxury Yacht - Cabin, mast, sail")
print("🚢 Aircraft Carrier - Flight deck, island")
print("")
print("OTHER FEATURES:")
print("🎨 Pattern Painter - Rainbow, Checkerboard, Stripes, Gradient, Heart, Target, Mario")
print("👁️ ESP with Player Names & Health")
print("🕊️ Fly Mode, No Clip, Speed Boost")
print("🤖 Auto Farm, Auto Collect, Auto Clicker")
print("⛵ Boat Speed Boost")
print("👑 God Mode")
print("=" .. string.rep("=", 60))
Script worked? 🚀 Boost it to #1 so others find it too.

Video Showcase

Comments (4)

Log in to add a comment.

Erene

Erene

2 months ago

I won't get banned, right?

aronaldrj3927

aronaldrj3927

2 months ago

no

alparslanbayazit1453504

alparslanbayazit1453504

2 months ago

Where do we enter the script (on the phone)?

uken2661715

uken2661715

6 months ago

best babft script bro

u9012683887827

u9012683887827Author

4 months ago

ty

u9012683887827

u9012683887827Author

7 months ago

Hi