local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Window = Rayfield:CreateWindow({ Name = "My Custom Hub", LoadingTitle = "Loading Interface...", LoadingSubtitle = "by YourName", ConfigurationSaving = { Enabled = false }, Discord = { Enabled = false }, KeySystem = false }) local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local VirtualUser = game:GetService("VirtualUser") local LocalPlayer = Players.LocalPlayer -- PLAYER TAB local MainTab = Window:CreateTab("Player", 4483362458) MainTab:CreateSection("Movement") MainTab:CreateSlider({ Name = "WalkSpeed", Range = {16, 250}, Increment = 1, Suffix = " Speed", CurrentValue = 16, Callback = function(Value) local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = Value end end, }) local InfJumpEnabled = false MainTab:CreateToggle({ Name = "Infinite Jump", CurrentValue = false, Callback = function(Value) InfJumpEnabled = Value end, }) UserInputService.JumpRequest:Connect(function() if InfJumpEnabled then local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") if hum then hum:ChangeState(Enum.HumanoidStateType.Jumping) end end end) MainTab:CreateButton({ Name = "Reset Character", Callback = function() local hum = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") if hum then hum.Health = 0 end end, }) MainTab:CreateSection("AFK") local AntiAFKEnabled = false LocalPlayer.Idled:Connect(function() if AntiAFKEnabled then VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new()) end end) MainTab:CreateToggle({ Name = "Anti AFK", CurrentValue = false, Callback = function(Value) AntiAFKEnabled = Value end, }) -- AUTO FARM TAB local FarmTab = Window:CreateTab("Auto Farm", 4483362458) FarmTab:CreateSection("Targets") local AutoFarmEnabled = false local AutoEquipHammer = false local HammerKeyword = "" local TargetDiamonds, TargetPigs, TargetMegaPigs, TargetRainbowPigs = true, true, true, true local CustomKeyword = "" local TargetPriority = "Nearest" local MovementMode = "Stay Still (Auto-Hit)" local HitDelay, HitRange, HitboxSize = 0.25, 25, 60 local ExpandHitboxEnabled = false local originalPartData = {} local HAMMER_WORDS = {"hammer", "mallet", "pickaxe", "sledge", "club", "bat", "axe", "smash", "break"} local function equipHammer() local char = LocalPlayer.Character local hum = char and char:FindFirstChildOfClass("Humanoid") local bp = LocalPlayer:FindFirstChildOfClass("Backpack") if not char or not hum or hum.Health <= 0 or not bp then return end local held = char:FindFirstChildOfClass("Tool") if held then if HammerKeyword == "" then return end if string.find(string.lower(held.Name), string.lower(HammerKeyword), 1, true) then return end end local chosen = nil if HammerKeyword ~= "" then local kw = string.lower(HammerKeyword) for _, t in ipairs(bp:GetChildren()) do if t:IsA("Tool") and string.find(string.lower(t.Name), kw, 1, true) then chosen = t break end end end if not chosen then for _, t in ipairs(bp:GetChildren()) do if t:IsA("Tool") then local low = string.lower(t.Name) for _, w in ipairs(HAMMER_WORDS) do if string.find(low, w, 1, true) then chosen = t break end end if chosen then break end end end end if not chosen then chosen = bp:FindFirstChildOfClass("Tool") end if chosen then hum:EquipTool(chosen) end end FarmTab:CreateToggle({ Name = "Auto Equip Hammer", CurrentValue = false, Callback = function(Value) AutoEquipHammer = Value if Value then equipHammer() end end, }) FarmTab:CreateInput({ Name = "Hammer Tool Name (Optional)", PlaceholderText = "Auto-detects hammer if blank", RemoveTextAfterFocusLost = false, Callback = function(Text) HammerKeyword = Text end, }) task.spawn(function() while true do if AutoEquipHammer then equipHammer() end task.wait(0.6) end end) FarmTab:CreateToggle({ Name = "Farm Diamonds", CurrentValue = true, Callback = function(v) TargetDiamonds = v end }) FarmTab:CreateToggle({ Name = "Farm Piggy Banks (Normal)", CurrentValue = true, Callback = function(v) TargetPigs = v end }) FarmTab:CreateToggle({ Name = "Farm Mega Pigs", CurrentValue = true, Callback = function(v) TargetMegaPigs = v end }) FarmTab:CreateToggle({ Name = "Farm Rainbow Pigs", CurrentValue = true, Callback = function(v) TargetRainbowPigs = v end }) FarmTab:CreateInput({ Name = "Extra Target Name", PlaceholderText = "Optional custom name", RemoveTextAfterFocusLost = false, Callback = function(Text) CustomKeyword = Text end, }) FarmTab:CreateSection("HP & Range") FarmTab:CreateDropdown({ Name = "HP Target Mode", Options = {"Nearest", "Most HP", "Less HP"}, CurrentOption = {"Nearest"}, MultipleOptions = false, Callback = function(Options) TargetPriority = Options[1] end, }) FarmTab:CreateToggle({ Name = "Expand Target Hitboxes (Far Hit)", CurrentValue = false, Callback = function(Value) ExpandHitboxEnabled = Value if not Value then for part, d in pairs(originalPartData) do if part and part.Parent then part.Size, part.Transparency, part.CanCollide = d.Size, d.Transparency, d.CanCollide end end table.clear(originalPartData) end end, }) FarmTab:CreateSlider({ Name = "Hitbox Size", Range = {15, 250}, Increment = 5, Suffix = " studs", CurrentValue = 60, Callback = function(v) HitboxSize = v end, }) FarmTab:CreateDropdown({ Name = "Movement Mode", Options = {"Stay Still (Auto-Hit)", "Walk to Target"}, CurrentOption = {"Stay Still (Auto-Hit)"}, MultipleOptions = false, Callback = function(Options) MovementMode = Options[1] end, }) FarmTab:CreateSlider({ Name = "Hit Range (Stay Still)", Range = {10, 300}, Increment = 10, Suffix = " studs", CurrentValue = 25, Callback = function(v) HitRange = v end, }) FarmTab:CreateSlider({ Name = "Tap Delay", Range = {0.1, 1.0}, Increment = 0.05, Suffix = "s", CurrentValue = 0.25, Callback = function(v) HitDelay = v end, }) local BLOCKED_WORDS = {"base", "plot", "tycoon", "home", "spawn", "lobby", "shop", "store", "upgrade", "button", "pad", "door", "wall", "fence", "shield", "jail", "guard"} local function isBlocked(obj) local cur = obj while cur and cur ~= workspace do local low = string.lower(cur.Name) for _, w in ipairs(BLOCKED_WORDS) do if string.find(low, w, 1, true) then return true end end cur = cur.Parent end return false end local function matchesTarget(name) local low = string.lower(name) if CustomKeyword ~= "" and string.find(low, string.lower(CustomKeyword), 1, true) then return true end if string.find(low, "pig", 1, true) then if string.find(low, "rainbow", 1, true) then return TargetRainbowPigs end if string.find(low, "mega", 1, true) then return TargetMegaPigs end return TargetPigs end return (string.find(low, "diamond", 1, true) or string.find(low, "gem", 1, true)) and TargetDiamonds end local function getPart(obj) if not obj or not obj.Parent then return nil end if obj:IsA("BasePart") then return obj end if obj:IsA("Model") then if obj.PrimaryPart and (originalPartData[obj.PrimaryPart] and originalPartData[obj.PrimaryPart].Transparency or obj.PrimaryPart.Transparency) < 0.95 then return obj.PrimaryPart end for _, d in ipairs(obj:GetDescendants()) do if d:IsA("BasePart") and (originalPartData[d] and originalPartData[d].Transparency or d.Transparency) < 0.95 then return d end end end return nil end local function isAlive(obj, part) if not obj or not obj.Parent or not obj:IsDescendantOf(workspace) or not part or not part.Parent or isBlocked(obj) then return false end if obj:GetAttribute("Broken") or obj:GetAttribute("Destroyed") or obj:GetAttribute("Dead") then return false end local hp = obj:GetAttribute("Health") or obj:GetAttribute("HP") if type(hp) == "number" and hp <= 0 then return false end local hum = obj:FindFirstChildOfClass("Humanoid") if hum and hum.Health <= 0 then return false end for _, c in ipairs(obj:GetChildren()) do if (c:IsA("NumberValue") or c:IsA("IntValue")) and (c.Name == "Health" or c.Name == "HP" or c.Name == "CurrentHealth") and c.Value <= 0 then return false end if c:IsA("BoolValue") and (c.Name == "Broken" or c.Name == "Destroyed" or c.Name == "IsBroken") and c.Value then return false end end local realTrans = originalPartData[part] and originalPartData[part].Transparency or part.Transparency return realTrans < 0.95 end local function getHP(obj) local attr = obj:GetAttribute("Health") or obj:GetAttribute("HP") or obj:GetAttribute("CurrentHealth") if type(attr) == "number" and attr > 0 then return attr end local hum = obj:FindFirstChildOfClass("Humanoid") if hum and hum.Health > 0 then return hum.Health end for _, d in ipairs(obj:GetDescendants()) do if (d:IsA("NumberValue") or d:IsA("IntValue")) and string.find(string.lower(d.Name), "hp", 1, true) and d.Value > 0 then return d.Value elseif d:IsA("TextLabel") then local num = string.match(d.Text, "^%s*([%d%,%.]+)") if num then local parsed = tonumber((string.gsub(num, ",", ""))) if parsed and parsed > 0 then return parsed end end end end return 1 end task.spawn(function() while true do if ExpandHitboxEnabled then for _, obj in ipairs(workspace:GetDescendants()) do if not isBlocked(obj) and matchesTarget(obj.Name) then local part = getPart(obj) if part and isAlive(obj, part) then if not originalPartData[part] then originalPartData[part] = { Size = part.Size, Transparency = part.Transparency, CanCollide = part.CanCollide } end part.Size = Vector3.new(HitboxSize, HitboxSize, HitboxSize) part.CanCollide = false part.Transparency = 0.85 end end end end task.wait(0.8) end end) local function findBestTarget(origin, maxDist, ignored) local bestObj, bestPart = nil, nil local bestDist = math.huge local bestHP = (TargetPriority == "Most HP") and -math.huge or math.huge for _, obj in ipairs(workspace:GetDescendants()) do if not ignored[obj] and not isBlocked(obj) and matchesTarget(obj.Name) then local part = getPart(obj) if part and isAlive(obj, part) then local dist = (part.Position - origin).Magnitude if dist <= maxDist then local hp = (TargetPriority ~= "Nearest") and getHP(obj) or 0 local better = (TargetPriority == "Most HP" and (hp > bestHP or (hp == bestHP and dist < bestDist))) or (TargetPriority == "Less HP" and (hp < bestHP or (hp == bestHP and dist < bestDist))) or (TargetPriority == "Nearest" and dist < bestDist) if better then bestHP, bestDist, bestObj, bestPart = hp, dist, obj, part end end end end end return bestObj, bestPart end local function hitTarget(char, cam, pos) if AutoEquipHammer then equipHammer() end local tool = char:FindFirstChildOfClass("Tool") if tool and tool.Parent == char then tool:Activate() end local sp, onScreen = cam:WorldToViewportPoint(pos) local vp = cam.ViewportSize local tap = onScreen and Vector2.new(sp.X, sp.Y) or Vector2.new(vp.X * 0.5, vp.Y * 0.5) VirtualUser:CaptureController() VirtualUser:ClickButton1(tap, cam.CFrame) end FarmTab:CreateToggle({ Name = "Auto Farm Selected Targets", CurrentValue = false, Callback = function(Value) AutoFarmEnabled = Value if not AutoFarmEnabled then return end task.spawn(function() local ignored = {} while AutoFarmEnabled do local char = LocalPlayer.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") local hum = char and char:FindFirstChildOfClass("Humanoid") local cam = workspace.CurrentCamera if hrp and hum and hum.Health > 0 and cam then local maxR = (MovementMode == "Stay Still (Auto-Hit)") and HitRange or math.huge local obj, part = findBestTarget(hrp.Position, maxR, ignored) if not obj and next(ignored) then table.clear(ignored) obj, part = findBestTarget(hrp.Position, maxR, ignored) end if obj and part then if MovementMode == "Stay Still (Auto-Hit)" then if isAlive(obj, part) then hitTarget(char, cam, part.Position) end task.wait(HitDelay) else local t0, checkT, lastPos, stuck = os.clock(), os.clock(), hrp.Position, 0 while AutoFarmEnabled and isAlive(obj, part) do char = LocalPlayer.Character hrp = char and char:FindFirstChild("HumanoidRootPart") hum = char and char:FindFirstChildOfClass("Humanoid") if not hrp or not hum or hum.Health <= 0 or (os.clock() - t0) > 4.5 then ignored[obj] = true break end local dist = (part.Position - hrp.Position).Magnitude if dist > 8 then hum:MoveTo(part.Position) if (os.clock() - checkT) >= 1.2 then if (hrp.Position - lastPos).Magnitude < 2 then stuck = stuck + 1 if stuck >= 2 then ignored[obj] = true break end else stuck = 0 end lastPos, checkT = hrp.Position, os.clock() end end local reach = ExpandHitboxEnabled and math.max(18, HitboxSize * 0.6) or 18 if dist <= reach and isAlive(obj, part) then hitTarget(char, cam, part.Position) end local el = 0 while el < HitDelay and AutoFarmEnabled and isAlive(obj, part) do el = el + task.wait(0.03) end end if hum and hrp then hum:MoveTo(hrp.Position) end end else task.wait(0.2) end else task.wait(0.2) end end end) end, }) Rayfield:Notify({ Title = "Script Loaded", Content = "Tap 'Show Rayfield' at the top to open the UI.", Duration = 5, Image = 4483362458, })