local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local Workspace = game:GetService("Workspace")
local CoreGui = game:GetService("CoreGui")
local LocalPlayer = Players.LocalPlayer
local env = getgenv and getgenv() or _G
local WindUrl = "https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"
local State = env.IndraHubCustomFarm or {
CoinFarm = false,
KillNpcs = false,
MoveTime = 0.15,
}
env.IndraHubCustomFarm = State
env.IndraHubCustomFarmError = nil
env.IndraHubCustomFarmLoaded = true
local function guiParent()
if gethui then return gethui() end
return CoreGui
end
local function fetch(url, cache)
if readfile then
local ok, data = pcall(readfile, cache)
if ok and type(data) == "string" and #data > 1000 then return data end
end
local data = game:HttpGet(url)
if writefile then pcall(function() writefile(cache, data) end) end
return data
end
local function safe(fn)
local ok, err = pcall(fn)
if not ok then warn("[IndraHub]", err) end
return ok
end
local function characterRoot()
local character = LocalPlayer.Character
return character and (character.PrimaryPart or character:FindFirstChild("HumanoidRootPart"))
end
local function ownedPlot()
local plots = Workspace:FindFirstChild("Map")
and Workspace.Map:FindFirstChild("Plots")
if not plots then return nil end
for _, plot in ipairs(plots:GetChildren()) do
if plot:IsA("Model") and plot:GetAttribute("Owner") == LocalPlayer.Name then
return plot
end
end
end
local function eachCoin(callback)
local folder = Workspace.Terrain:FindFirstChild("CoinFolder")
if not folder then return end
for _, coin in ipairs(folder:GetChildren()) do
if coin:IsA("Attachment") then
callback(coin)
end
end
end
local function collectCoins()
local root = characterRoot()
if not root then return end
eachCoin(function(coin)
local tween = TweenService:Create(
root,
TweenInfo.new(State.MoveTime, Enum.EasingStyle.Linear),
{ CFrame = CFrame.new(coin.WorldPosition) }
)
tween:Play()
tween.Completed:Wait()
end)
end
local function wipeOwnedNpcs()
local plot = ownedPlot()
local npcs = plot and plot:FindFirstChild("Npcs")
if not npcs then return end
for _, npc in ipairs(npcs:GetChildren()) do
local humanoid = npc:IsA("Model") and npc:FindFirstChildWhichIsA("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid.Health = 0
end
end
end
task.spawn(function()
while task.wait() do
if State.CoinFarm then safe(collectCoins) end
end
end)
local function makeBasicUi()
local parent = guiParent()
local old = parent:FindFirstChild("IndraHubCustomFarmBasic")
if old then old:Destroy() end
local gui = Instance.new("ScreenGui")
gui.Name = "IndraHubCustomFarmBasic"
gui.ResetOnSpawn = false
gui.Parent = parent
local frame = Instance.new("Frame")
frame.Size = UDim2.fromOffset(260, 150)
frame.Position = UDim2.fromOffset(30, 180)
frame.BackgroundColor3 = Color3.fromRGB(15, 17, 24)
frame.BorderSizePixel = 0
frame.Active = true
frame.Draggable = true
frame.Parent = gui
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 10)
local title = Instance.new("TextLabel")
title.BackgroundTransparency = 1
title.Size = UDim2.new(1, -20, 0, 28)
title.Position = UDim2.fromOffset(10, 6)
title.Font = Enum.Font.GothamBold
title.TextSize = 14
title.TextColor3 = Color3.new(1, 1, 1)
title.TextXAlignment = Enum.TextXAlignment.Left
title.Text = "IndraHub"
title.Parent = frame
local function addToggle(text, y, key)
local button = Instance.new("TextButton")
button.Size = UDim2.new(1, -20, 0, 34)
button.Position = UDim2.fromOffset(10, y)
button.BackgroundColor3 = Color3.fromRGB(30, 38, 54)
button.BorderSizePixel = 0
button.Font = Enum.Font.GothamBold
button.TextSize = 12
button.TextColor3 = Color3.new(1, 1, 1)
button.Parent = frame
Instance.new("UICorner", button).CornerRadius = UDim.new(0, 7)
local function draw()
button.Text = text .. ": " .. (State[key] and "ON" or "OFF")
button.BackgroundColor3 = State[key] and Color3.fromRGB(36, 110, 70) or Color3.fromRGB(30, 38, 54)
end
button.MouseButton1Click:Connect(function()
State[key] = not State[key]
draw()
end)
draw()
end
addToggle("Coins", 44, "CoinFarm")
addToggle("Kill Npcs", 84, "KillNpcs")
end
task.spawn(function()
while task.wait(0.15) do
if State.KillNpcs then safe(wipeOwnedNpcs) end
end
end)
makeBasicUi()
local function loadWindUi()
return loadstring(fetch(WindUrl, "IndraHub_CustomFarm_WindUI.lua"))()
end
local ok, WindUI = pcall(loadWindUi)
if not ok or type(WindUI) ~= "table" then
warn("[IndraHub] WindUI failed")
env.IndraHubCustomFarmError = tostring(WindUI)
return
end
if env.IndraHubCustomFarmWindow then
pcall(function() env.IndraHubCustomFarmWindow:Destroy() end)
end
local uiOk, uiErr = pcall(function()
local Window = WindUI:CreateWindow({
Title = "IndraHub",
Icon = "coins",
Author = "Auto Farm",
Folder = "IndraHubCustomFarm",
Size = UDim2.fromOffset(520, 360),
Transparent = true,
Theme = "Dark",
Resizable = true,
})
env.IndraHubCustomFarmWindow = Window
if Window.SetToggleKey then Window:SetToggleKey(Enum.KeyCode.RightControl) end
if Window.EditOpenButton then Window:EditOpenButton({ Title = "IndraHub", Icon = "coins", Draggable = true }) end
local Farm = Window:Tab({ Title = "Farm", Icon = "wheat" })
local Settings = Window:Tab({ Title = "Settings", Icon = "settings" })
Farm:Toggle({
Title = "Auto Collect Coins",
Value = State.CoinFarm,
Callback = function(value)
State.CoinFarm = value
end,
})
Farm:Toggle({
Title = "Instant Kill Npcs",
Value = State.KillNpcs,
Callback = function(value)
State.KillNpcs = value
end,
})
Settings:Slider({
Title = "Tween Time",
Value = { Min = 0.01, Max = 1, Default = State.MoveTime },
Step = 0.01,
Callback = function(value)
State.MoveTime = tonumber(value) or State.MoveTime
end,
})
Settings:Button({
Title = "Collect Coins Once",
Callback = function()
safe(collectCoins)
end,
})
pcall(function()
WindUI:Notify({
Title = "IndraHub",
Content = "Loaded. RightControl toggles UI.",
Icon = "coins",
Duration = 4,
})
end)
end)
if not uiOk then
env.IndraHubCustomFarmError = tostring(uiErr)
warn("[IndraHub] UI failed", uiErr)
end
Comments
No comments yet
Be the first to share your thoughts!