local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))()

local Window = Rayfield:CreateWindow({
   Name = "Random Hub",
   LoadingTitle = "Random Cool Hub",
   LoadingSubtitle = "by Random",
   ConfigurationSaving = {
      Enabled = true,
      FolderName = nil, -- Create a custom folder for your hub/game
      FileName = "Random Hub"
   },
   Discord = {
      Enabled = false,
      Invite = "noinvitelink", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
      RememberJoins = true -- Set this to false to make them join the discord every time they load it up
   },
   KeySystem = false, -- Set this to true to use our key system
   KeySettings = {
      Title = "Untitled",
      Subtitle = "Key System",
      Note = "No method of obtaining the key is provided",
      FileName = "Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
      SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
      GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
      Key = {"Hello"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
   }
})

local MainTab = Window:CreateTab("MainTab", nil) -- Title, Image
local MainSection = MainTab:CreateSection("")

Rayfield:Notify({
   Title = "Random Hub",
   Content = "Loaded",
   Duration = 3,
   Image = nil,
   Actions = { -- Notification Buttons
      Ignore = {
         Name = "Great!",
         Callback = function()
         print("The user tapped Great!")
      end
   },
},
})

local Button = MainTab:CreateButton({
   Name = "Auto Farm",

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")

local function moveToPosition(position)
    humanoidRootPart.CFrame = CFrame.new(position)
end

local function attack()
    local tool = character:FindFirstChildOfClass("Tool")
    if tool then
        tool:Activate()
    end
end

while true do

    local farmingPosition = Vector3.new(100, 10, 100)
    moveToPosition(farmingPosition)
    
    for i = 1, 10 do
        attack()
        wait(0.5) -- Adjust the wait time as needed
    end
    
    wait(1) -- Adjust the wait time as needed
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: