AutoFarm
Key Required

AutoFarm

πŸ’Ž Ore Smelting TycoonSanTerSanTer 3.7K views 19 executesUpdated Jan 6, 2025
5.0/ 5(2 votes)
20100% Positive
Lua Scriptβ€’196 lines (5135 chars)
local osclockBefore = os.clock()
local LibrarySrc =
	game:HttpGetAsync("https://github.com/ActualMasterOogway/Fluent-Renewed/releases/latest/download/Fluent.luau")
LibrarySrc = loadstring(LibrarySrc)
local Library: FluentUI
Library = LibrarySrc() :: FluentUI
print("took " .. os.clock() - osclockBefore .. "s to load Fluent Renewed library..")

local ReplicatedStorage = game:GetService("ReplicatedStorage") :: ReplicatedStorage
local LPlayer = (game:GetService("Players") :: Players).LocalPlayer

local Tycoons = workspace:FindFirstChild("Tycoons") :: Folder
local Stats = ReplicatedStorage.Data:FindFirstChild(LPlayer.Name).Stats :: Folder

local cache = {
	buttons = {} :: { Part },
}

local section

local function getRandomSubtitle()
	local randommessages = {
		"very pro skibidi",
		"worst ever script",
		"imagine using script on tycoon game",
		"heh",
		"wheres sub title",
		"by santer",
	}

	math.randomseed(os.clock())

	local random = math.random(1, #randommessages)
	return randommessages[random]
end

local function getTycoon(): Model
	return Tycoons:FindFirstChild(LPlayer.Team.Name) :: Model
end

local function getDrops(): Folder
	return getTycoon():FindFirstChild("Drops") :: Folder
end

local function smeltOres()
	local clickdetector = (
			(getTycoon():FindFirstChild("Smelter") :: Model):FindFirstChild("Smelt") :: Part
		):FindFirstChild("ClickDetector") :: ClickDetector

	fireclickdetector(clickdetector, 1)
end

local function collectDrops()
	local event = LPlayer.Backpack["Pick Ores"]:FindFirstChild("Collect")
	for i, v in getDrops():GetChildren() do
		event:FireServer(v)
	end
end

local Window = Library:CreateWindow({
	Title = "Ore Smelting Tycoon: script",
	SubTitle = getRandomSubtitle(),
	TabWidth = 160,
	Size = UDim2.fromOffset(830, 525),
	Resize = true,
	MinSize = Vector2.new(470, 380),
	Acrylic = true,
	Theme = "Dark",
	MinimizeKey = Enum.KeyCode.LeftControl,
})

local Tabs = {
	Main = Window:CreateTab({
		Title = "Main",
		Icon = "app-window",
	}),
}

do
	section = Tabs.Main:AddSection("Farm")
	do
		section:CreateButton({
			Title = "πŸ’§ Collect all drops",
			Description = "Tool needs to be unequipped.",
			Callback = collectDrops,
		})

		section:CreateButton({
			Title = "πŸ”₯ Smelt ores",
			Callback = smeltOres,
		})

		local upvalue1 = false
		section:CreateToggle("", {
			Title = "πŸ›’ Auto buy ore buttons",
			Description = "5 second repeat cooldown.",
			Callback = function(v)
				upvalue1 = v
			end,
		})
		-- caching buttons idk why
		local tycoon = getTycoon()
		for i, v in tycoon:FindFirstChild("Buttons"):GetChildren() do
			table.insert(cache.buttons, v)
		end
		for i, v in tycoon:FindFirstChild("Buttons2"):GetChildren() do
			table.insert(cache.buttons, v)
		end
		for i, v in tycoon:FindFirstChild("Buttons3"):GetChildren() do
			table.insert(cache.buttons, v)
		end
		task.spawn(function()
			while task.wait(5) do
				if not upvalue1 then
					continue
				end

				local humpart = LPlayer.Character:FindFirstChild("HumanoidRootPart")
				for i, v in cache.buttons do
					local button = v:FindFirstChild("Button") :: Part
					if button.Transparency ~= 1 then
						firetouchinterest(humpart, button, 0)
						firetouchinterest(humpart, button, 1)
					end

					task.wait() -- waiting for the next frame so no lags!!
				end
			end
		end)

		local upvalue2 = false
		section:CreateToggle("", {
			Title = "βš™οΈ Auto collect & smelt",
			Description = "1 second repeat cooldown.",
			Callback = function(v)
				upvalue2 = v
			end,
		})
		task.spawn(function()
			while task.wait(1) do
				if not upvalue2 then
					continue
				end
				collectDrops()
				smeltOres()
			end
		end)
	end

	section = Tabs.Main:AddSection("Obby")
	do
		section:CreateButton({
			Title = "πŸ’Ž Get hard obby reward",
			Callback = function()
				firetouchinterest(
					LPlayer.Character:FindFirstChild("HumanoidRootPart"),
					(workspace:FindFirstChild("HardObby") :: Model):FindFirstChild("Reward") :: Part,
					0
				)
				firetouchinterest(
					LPlayer.Character:FindFirstChild("HumanoidRootPart"),
					(workspace:FindFirstChild("HardObby") :: Model):FindFirstChild("Reward") :: Part,
					1
				)
			end,
		})

		section:CreateButton({
			Title = "🍬 Get easy obby reward",
			Callback = function()
				firetouchinterest(
					LPlayer.Character:FindFirstChild("HumanoidRootPart"),
					(workspace:FindFirstChild("EasyObby") :: Model):FindFirstChild("Reward") :: Part,
					0
				)
				firetouchinterest(
					LPlayer.Character:FindFirstChild("HumanoidRootPart"),
					(workspace:FindFirstChild("EasyObby") :: Model):FindFirstChild("Reward") :: Part,
					1
				)
			end,
		})
	end
end

Stats:FindFirstChild("HardObbyCooldown").Changed:Connect(function()
	if Stats:FindFirstChild("HardObbyCooldown").Value == 0 then
		Library:Notify({ Title = "Obby cooldown", Content = "Now you can beat hard obby again!", Duration = 5 })
	end
end)

Stats:FindFirstChild("EasyObbyCooldown").Changed:Connect(function()
	if Stats:FindFirstChild("EasyObbyCooldown").Value == 0 then
		Library:Notify({ Title = "Obby cooldown", Content = "Now you can beat easy obby again!", Duration = 5 })
	end
end)

Features & Information

Farming: πŸ’§ Collect all drops πŸ”₯ Smelt ores πŸ›’ Auto buy ore buttons βš™οΈ Auto collect & smelt Obby rewards: πŸ’Ž Get hard obby reward 🍬 Get easy obby reward (also has notify when you can again get hard/easy obby reward!!!!)
#farm#farming#afk

Community Comments (5)

CharlesLec16F1CharlesLec16F1Jan 6, 2025(edited)

Worked on Solara

SanTerSanTerJan 6, 2025(edited)

yes cause theres no hookmetamethods :money_mouth:

barconbarconJan 6, 2025(edited)

no way you use "::" and ":"

SanTerSanTerJan 6, 2025(edited)

not my fault :broken_heart: blame https://github.com/JohnnyMorganz/luau-lsp

6yvem5db36yvem5db3Jan 13, 2025(edited)

я пСдик

More Scripts for πŸ’Ž Ore Smelting Tycoon