MADE BY Michael1541#9506
- AUTO FARM ORES AND TREES
- AND MORE!
GAME LINK:
KNIGHTFALL RPG
SCRIPT:
--[[
Created by Michael1541#9506
UI Library: credits wally & remake by Aika https://v3rmillion.net/showthread.php?tid=1040650
Update: Added autoFarms for ores and trees
Before using God Mode have sword out
Inf Coins only works in Valcano Island
Spells cost Coins
Boss Auto Farm only works in Boss Fight
I plan on adding more features, have fun.
--]]
getgenv().getCoins = false
getgenv().autofarms = false
getgenv().bAutoFarm = false
getgenv().tpChests = false
getgenv().godMode = false
getgenv().buySpells = false
getgenv().autoMine = false
getgenv().autoChop = false
local remotePath = game:GetService("ReplicatedStorage").Events
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local mob = workspace.Creatures
local tpservice = game:GetService("TeleportService")
local rock = workspace.Destroyable.Rocks
local tree = workspace.Destroyable.Trees
local library = loadstring(game:HttpGet(('https://raw.githubusercontent.com/508droid/AikaV3rm-UI-Lib/main/Lib.lua')))()
local w = library:CreateWindow("KnightFall RPG")
local a = w:CreateFolder("Auto Farm")
local b = w:CreateFolder("Combat")
local c = w:CreateFolder("Teleport")
local d = w:CreateFolder("Money")
local e = w:CreateFolder("DestroyGui")
a:Toggle("Mobs",function(bool)
getgenv().autofarms = bool
print("Mobs is: ", bool)
if bool then
plsWork()
if game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui") then
game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui"):Destroy()
else
print("Pancakes")
end
else
workspace.Gravity = 100
end
end)
a:Toggle("Ores",function(bool)
getgenv().autoMine = bool
print("Ores is: ", bool)
if bool then
mine()
if game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui") then
game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui"):Destroy()
else
print("Pancakes")
end
else
workspace.Gravity = 100
end
end)
a:Toggle("Trees",function(bool)
getgenv().autoChop = bool
print("Trees is: ", bool)
if bool then
chop()
if game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui") then
game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui"):Destroy()
else
print("Pancakes")
end
else
workspace.Gravity = 100
end
end)
a:Toggle("Boss Auto Farm",function(bool)
getgenv().bAutoFarm = bool
print("Boss Auto Farm is: ", bool)
if bool then
extraMob()
if game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui") then
game.Players.LocalPlayer.Character.HumanoidRootPart:FindFirstChild("BillboardGui"):Destroy()
else
print("Pancakes")
end
else
workspace.Gravity = 100
end
end)
b:Toggle("God Mode",function(bool)
getgenv().godMode = bool
print("godMode is: ", bool)
if bool then
unDead()
end
end)
c:Toggle("Tp to Chests",function(bool)
getgenv().tpChests = bool
print("Tp to Chests is: ", bool)
if bool then
autoChests()
else
workspace.Gravity = 100
end
end)
c:Dropdown("World",{"Starter","Valcano Island","Dungon" ,"Boss Battle"},true,function(value)
worldSelect = value
print(value)
end)
c:Button("Teleport Selected",function()
if worldSelect then
tping(worldSelect)
end
end)
d:Toggle("Inf Coins",function(bool)
getgenv().getCoins = bool
print("Inf Coins is: ", bool)
if bool then
infCoins()
end
end)
d:Dropdown("Spells",{"Fireball","Weak Ice Spell","Moderate Ice Spell" ,"Powerful Ice Spell"},true,function(value2)
buyType = value2
print(value2)
end)
d:Button("Buy Spell",function()
if buyType then
buySpell(buyType)
end
end)
e:DestroyGui()
function infCoins()
spawn(function()
game:GetService('RunService').Stepped:connect(function()
if getgenv().getCoins == true then
remotePath.GivePickaxe:FireServer()
remotePath.SellItem:FireServer("pic", 1)
wait()
end
end)
end)
end
function plsWork()
spawn(function()
setsimulationradius(math.huge, math.huge)
workspace.Gravity = 0
workspace.FallenPartsDestroyHeight = math.huge - math.huge
while getgenv().autofarms == true do
local hrp = mob:FindFirstChild("HumanoidRootPart", true)
hum = hrp.Parent:FindFirstChildOfClass("Humanoid")
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = hrp.CFrame * CFrame.new(0, 10, 0)
remotePath.SwingValue:FireServer()
game.ReplicatedStorage.Events.SwordTouched:FireServer(hrp, game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool").Hitbox)
remotePath.ClearHitTable:FireServer()
if isnetworkowner(hrp) and hum.Health ~= hum.MaxHealth then
hum.Health = 0
end
wait()
end
end)
end
function mine()
spawn(function()
setsimulationradius(math.huge, math.huge)
workspace.FallenPartsDestroyHeight = math.huge - math.huge
workspace.Gravity = 5
while getgenv().autoMine == true do
local rck = rock:FindFirstChild("DisplayBlock", true)
hit = rck.Parent:FindFirstChild("Hitbox")
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = rck.CFrame * CFrame.new(0, 6, 0)
remotePath.hitObject:FireServer(rck.Parent, plr.Character:FindFirstChildOfClass("Tool").Name)
if isnetworkowner(rck) and hit.Health.Value ~= 99999999 then
hit.Health.Value = 0
end
wait()
end
end)
end
function chop()
spawn(function()
setsimulationradius(math.huge, math.huge)
workspace.FallenPartsDestroyHeight = math.huge - math.huge
workspace.Gravity = 5
while getgenv().autoChop == true do
local tre = tree:FindFirstChild("DisplayBlock", true)
hit = tre.Parent:FindFirstChild("Hitbox")
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = tre.CFrame * CFrame.new(0, 8, 8)
remotePath.hitObject:FireServer(tre.Parent, plr.Character:FindFirstChildOfClass("Tool").Name, "Axes")
if isnetworkowner(tre) and hit.Health.Value ~= 99999999 then
hit.Health.Value = 0
end
wait()
end
end)
end
function extraMob()
spawn(function()
setsimulationradius(math.huge, math.huge)
workspace.Gravity = 0
workspace.FallenPartsDestroyHeight = math.huge - math.huge
while getgenv().bAutoFarm == true do
local spi = workspace["Spider King"]
local leg = spi:FindFirstChild("HumanoidRootPart", true)
hum = leg.Parent:FindFirstChildOfClass("Humanoid")
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = leg.CFrame * CFrame.new(0, 10, 0)
remotePath.SwingValue:FireServer()
game.ReplicatedStorage.Events.SwordTouched:FireServer(leg, game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool").Hitbox)
remotePath.ClearHitTable:FireServer()
if isnetworkowner(leg) and hum.Health ~= hum.MaxHealth then
hum.Health = 0
end
wait()
end
end)
end
function autoChests()
spawn(function()
while getgenv().tpChests == true do
workspace.Gravity = 0
function findChest()
for i, wood in next, Workspace.ChestContainer:GetChildren() do
if tostring(wood) == 'Wood Chest' or 'Metal Chest' or 'Gold Chest' or 'Silver Chest' or 'Ruby Chest' or ' ' then
remotePath.OpenChest:FireServer(wood)
end
end
end
function tpChest()
for i, chest in next, Workspace.ChestSpawnContainer:GetChildren() do
if tostring(chest) == 'Common' then
plr.Character.HumanoidRootPart.CFrame=chest.CFrame
findChest()
wait(0.7)
end
end
end
tpChest()
wait()
end
end)
end
function unDead()
spawn(function()
while getgenv().godMode == true do
plr.Character.Humanoid:Remove()
Instance.new('Humanoid',plr.Character)
wait()
getgenv().godMode = false
end
end)
end
local tpservice = game:GetService("TeleportService")
local plr = game.Players.LocalPlayer
local PlaceID1 = 2897314781
local PlaceID2 = 3624193198
local PlaceID3 = 3219354523
local PlaceID4 = 5187808082
function tping()
if worldSelect == "Starter" then
tpservice:Teleport(PlaceID1, plr)
end
if worldSelect == "Valcano Island" then
tpservice:Teleport(PlaceID2, plr)
end
if worldSelect == "Dungon" then
tpservice:Teleport(PlaceID3, plr)
end
if worldSelect == "Boss Battle" then
tpservice:Teleport(PlaceID4, plr)
end
end
function buySpell()
if buyType == "Weak Ice Spell" then
remotePath.PurchaseSpell:FireServer(game:GetService("ReplicatedStorage").Modules.SpellbookModule ,"Spellbook", "Weak Ice Spell")
end
if buyType == "Moderate Ice Spell" then
remotePath.PurchaseSpell:FireServer(game:GetService("ReplicatedStorage").Modules.SpellbookModule ,"Spellbook", "Moderate Ice Spell")
end
if buyType == "Powerful Ice Spell" then
remotePath.PurchaseSpell:FireServer(game:GetService("ReplicatedStorage").Modules.SpellbookModule ,"Spellbook", "Powerful Ice Spell")
end
if buyType == "Fireball" then
remotePath.PurchaseSpell:FireServer(game:GetService("ReplicatedStorage").Modules.SpellbookModule ,"Spellbook", "Fireball")
end
end