local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local VirtualInputManager = game:GetService("VirtualInputManager")
local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local rootPart = character:WaitForChild("HumanoidRootPart")
player.CharacterAdded:Connect(function(newChar)
character = newChar
rootPart = newChar:WaitForChild("HumanoidRootPart")
end)
-- CONFIG
local Config = {
FarmStatus = false,
Skill1 = false,
Skill2 = false,
AutoClick = false,
ClickSpeed = 0.1,
BossName = "",
MobName = "",
Distance = 5,
Height = 2,
Noclip = true
}
local enemyFolder = workspace:WaitForChild("Enemies")
local function getUniqueEnemies()
local names = {"None"}
local seen = {}
for _, v in pairs(enemyFolder:GetChildren()) do
if not seen[v.Name] then
table.insert(names, v.Name)
seen[v.Name] = true
end
end
return names
end
local Window = Rayfield:CreateWindow({
Name = "DFT Premium Hub",
LoadingTitle = "Pro Farm System",
LoadingSubtitle = "Keybind Interface Active",
ConfigurationSaving = { Enabled = false }
})
--- MAIN TAB ---
local MainTab = Window:CreateTab("🔥 Main", 4483362458)
MainTab:CreateSection("🎯 Target Selection")
local BossDropdown = MainTab:CreateDropdown({
Name = "Select Boss (Priority)",
Options = getUniqueEnemies(),
CurrentOption = {"None"},
Callback = function(Option) Config.BossName = Option[1] == "None" and "" or Option[1] end,
})
local MobDropdown = MainTab:CreateDropdown({
Name = "Select Mob (Farm)",
Options = getUniqueEnemies(),
CurrentOption = {"None"},
Callback = function(Option) Config.MobName = Option[1] == "None" and "" or Option[1] end,
})
MainTab:CreateButton({
Name = "🔄 Refresh Enemy Lists",
Callback = function()
local newNames = getUniqueEnemies()
BossDropdown:Refresh(newNames)
MobDropdown:Refresh(newNames)
end,
})
MainTab:CreateSection("⚔️ Combat & Execution")
-- KEYBIND INFO TEXT
MainTab:CreateLabel("Hotkey: [Right Control] to RUN/STOP Clicker")
MainTab:CreateToggle({
Name = "ENABLE AUTO-FARM",
CurrentValue = false,
Callback = function(Value) Config.FarmStatus = Value end,
})
local ClickToggle = MainTab:CreateToggle({
Name = "Auto Left-Click",
CurrentValue = false,
Callback = function(Value) Config.AutoClick = Value end,
})
MainTab:CreateToggle({
Name = "Spam Skill [1]",
CurrentValue = false,
Callback = function(Value) Config.Skill1 = Value end,
})
MainTab:CreateToggle({
Name = "Spam Skill [2]",
CurrentValue = false,
Callback = function(Value) Config.Skill2 = Value end,
})
--- SETTINGS TAB ---
local SettingsTab = Window:CreateTab("⚙️ Config", 4483362458)
SettingsTab:CreateSection("Speeds")
SettingsTab:CreateSlider({
Name = "Click/Loop Speed",
Range = {0.05, 1},
Increment = 0.05,
Suffix = "sec",
CurrentValue = 0.1,
Callback = function(Value) Config.ClickSpeed = Value end,
})
SettingsTab:CreateSection("Safety & System")
SettingsTab:CreateToggle({
Name = "Noclip",
CurrentValue = true,
Callback = function(Value) Config.Noclip = Value end,
})
SettingsTab:CreateButton({
Name = "❌ Destroy Script",
Callback = function()
Config.FarmStatus = false
Config.AutoClick = false
Rayfield:Destroy()
end,
})
--- KEYBIND LOGIC ---
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed and input.KeyCode == Enum.KeyCode.RightControl then
Config.AutoClick = not Config.AutoClick
ClickToggle:Set(Config.AutoClick) -- Sync UI
local stateText = Config.AutoClick and "RUNNING" or "STOPPED"
Rayfield:Notify({
Title = "Clicker Status",
Content = "Auto-Clicker is now " .. stateText,
Duration = 2
})
end
end)
--- CORE LOGIC ---
function getTarget()
local boss, nearestMob = nil, nil
local minMobDist = math.huge
for _, enemy in pairs(enemyFolder:GetChildren()) do
local root = enemy:FindFirstChild("HumanoidRootPart")
local hum = enemy:FindFirstChildOfClass("Humanoid")
if root and (not hum or hum.Health > 0) then
if Config.BossName ~= "" and enemy.Name == Config.BossName then
boss = enemy; break
elseif Config.MobName ~= "" and enemy.Name == Config.MobName then
local dist = (rootPart.Position - root.Position).Magnitude
if dist < minMobDist then minMobDist = dist; nearestMob = enemy end
end
end
end
return boss or nearestMob
end
-- Click Loop
task.spawn(function()
while true do
if Config.AutoClick and Config.FarmStatus and getTarget() then
VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
task.wait(0.05)
VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
end
task.wait(Config.ClickSpeed)
end
end)
-- Skill Loop
task.spawn(function()
while true do
if Config.FarmStatus and getTarget() then
if Config.Skill1 then VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.One, false, game) end
if Config.Skill2 then VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Two, false, game) end
end
task.wait(0.2)
end
end)
-- Movement
RunService.Heartbeat:Connect(function()
if not Config.FarmStatus or not rootPart or not rootPart.Parent then return end
local target = getTarget()
if target and target:FindFirstChild("HumanoidRootPart") then
local tRoot = target.HumanoidRootPart
rootPart.CFrame = CFrame.lookAt((tRoot.CFrame * CFrame.new(0, Config.Height, Config.Distance)).Position, tRoot.Position)
end
end)
Comments
No comments yet
Be the first to share your thoughts!