Neon Knight AutoFarm 1.lua 1
Neon Knight AutoFarm 1.lua 1
Neon Knight AutoFarm 1.lua 1
--[[
--//Regions:
"Outerwall"
"Shallows"
"Yaramo"
"Mantle"
"Vertigo"
"Midnight"
"Junction"
--//Difficulty:
"very easy"
"easy"
"light"
"normal"
"extra"
"hard"
"very hard"
--//Info
Can only go if unlocked that region
Script requires melee weapon equipped
Execute in lobby and wait 5 seconds
--//Auto Buy
Auto buy items from shops and vending machines
Examples:
--//Path
Choose Region to go after finished Outerwall or Shallows
Currently, "Yaramo" or "Mantle"
]]
local ToggleKey = Enum.KeyCode.L
local Settings = {
Region = "Midnight", -- Dive starting region, specified region need to be
unlocked first
LeaveAtRegion = "Midnight", -- nil for completing until Dreams, put your
desired area if you want to leave at specify area example "Shallows"
Difficulty = "very easy",
Special = false,
NextRegion = true, -- Keep it true so you can synced all the items from the
dive
AutoSell = true,
TempFarm = false, -- Pillar Farm and SYNC farm
RarityFilterGear = "Alpha", -- Examples: "Pristine" Ignores Pristine and
above, "Legendary" Ignores Legendary and above. Filters: Pristine, Experimental,
Legendary, Alpha, Omega, Core
RarityFilterGun = "Omega",
Path = {
"Yaramo" --"Yaramo" or "Mantle"
},
MeleeSlot = 1, --For Auto Equip
GearSlots = {2, 3}, --For Auto Use
AutoUseShardMachine = true,
AutoUseMedicalMachine = true,
AutoUseMedicalMachineHP = .5, --Example: .5, Use Medical Vending Machine when
hp lower than 50% of max hp
AutoBuy = true,
AutoBuyItem = {
{"FieRamen", 0},
{"FieMilk", 0},
{"FieDango", 80},
{"FieBar", 0},
{"YaramoWich", 0},
{"YaramoIcecream", 0},
{"YaramoYogurt", 0},
{"VertigoMask", 0},
{"VertigoNotebook", 0},
{"MocoSodahealth", 0},
{"MocoSodaattack", 0},
{"MocoSodaresist", 0},
{"MocoSodagear", 0},
{"MocoSodaomni", 0},
{"MocoSnackwich", 120},
{"MocoSnackbanana", 60}
},
}
local RarityTable = {
["Scrap"] = 0,
["Basic"] = 156,
["Common"] = 356,
["Uncommon"] = 619,
["Unique"] = 744,
["Rare"] = 844,
["Pristine"] = 914,
["Experimental"] = 959,
["Legendary"] = 984,
["Alpha"] = 994,
["Omega"] = 999,
["Core"] = 1000,
}
if lp.PlayerGui:FindFirstChild("Intro") then
local intro, t, conn = lp.PlayerGui.Intro, coroutine.running()
conn = intro:GetPropertyChangedSignal("Parent"):Connect(function()
coroutine.resume(t)
conn:Disconnect()
end)
coroutine.yield()
end
function Press(Path)
for i,v in pairs(getconnections(Path)) do
v:Function();
end
end
if game.PlaceId == 8256771516 then
--//Services
local HttpService = game:GetService("HttpService");
local Difficultytbl = {
["very easy"] = -3,
["easy"] = -2,
["light"] = -1,
["normal"] = 0,
["extra"] = 1,
["hard"] = 2,
["very hard"] = 3,
["crucible"] = 4,
}
function saveSettings()
local savedTable = HttpService:JSONEncode(Settings);
writefile("NK_Settings.json", savedTable);
Settings = HttpService:JSONDecode(readfile("NK_Settings.json"));
end
saveSettings();
wait(5)
if Settings.AutoSell then
Press(lp.PlayerGui.Inventory.Buttons.Inventory.Item.Button.MouseButton1Click)
wait(.5)
Press(lp.PlayerGui.Inventory.Buttons.Exit.Exit.MouseButton1Click)
game.Lighting.Blur.Enabled = false
for _,v in pairs(lp.Guns:GetChildren()) do
if v:FindFirstChild("Slot") and v.Slot.Value == 0 then
if Settings.RarityFilterGun ~= nil and
Settings.RarityFilterGun ~= "" then
if lp.Sessionstats.Guncache:FindFirstChild(v.Name)
and lp.Sessionstats.Guncache:FindFirstChild(v.Name).Stats.Tags.Raritynum.Value <
RarityTable[Settings.RarityFilterGun] then
pur:InvokeServer("Sellgun", v)
end
end
if Settings.RarityFilterGun == nil or
Settings.RarityFilterGun == "" then
pur:InvokeServer("Sellgun", v)
end
end
wait()
end
if Settings.RarityFilterGear == nil or
Settings.RarityFilterGear == "" then
pur:InvokeServer("Sellgun", v)
end
end
wait()
end
end
--//Teleport
local Run = lp.PlayerGui.Run
local Close = Run.Runsummary.Main.Close
if not workspace:FindFirstChild("Dungeon") and not Close.Visible then
local t, conn = coroutine.running()
conn = Close:GetPropertyChangedSignal("Visible"):Connect(function()
if Close.Visible then
coroutine.resume(t)
conn:Disconnect()
end
end)
coroutine.yield()
--repeat wait(.1) until Run.Runsummary.Main.Close.Visible == true
end
--[[//Tables
local Settings = {};
--//Services
local HttpService = game:GetService("HttpService");
--//Functions
function loadSettings()
if isfile("NK_Settings.json") then
Settings = HttpService:JSONDecode(readfile("NK_Settings.json"));
end
end
function saveSettings()
local savedTable = HttpService:JSONEncode(Settings);
writefile("NK_Settings.json", savedTable);
Settings = HttpService:JSONDecode(readfile("NK_Settings.json"));
end
--///Setup
loadSettings();]]
local MT = getrawmetatable(game);
setreadonly(MT, false);
if workspace:FindFirstChild("Live") then
return
end
--//Tables
--local Settings = {};
local Used = {};
--//Cooldowns
local lastAttack = tick();
--//Globals
_G.Autofarm = true;
--//Services
local UIS = game:GetService("UserInputService");
local VIM = game:GetService("VirtualInputManager");
local Debris = game:GetService("Debris");
local HttpService = game:GetService("HttpService");
--//Setup
local Live
if not workspace:FindFirstChild("Live") then
Live = Instance.new("Folder");
Live.Name = "Live";
Live.Parent = workspace;
else
Live = workspace.Live
end
function getClosestMob()
local closestMob = nil;
local lastDistance = math.huge;
lastPart = nil;
if Mob:FindFirstChild("Status") and
Mob:FindFirstChild("Status"):FindFirstChild("Debuff_Invincible") and closestMob ~=
nil then
canContinue = false;
end
lastPart = Mob:FindFirstChild("Hitbox") or
Mob:FindFirstChild("Base") or Mob:FindFirstChild("HumanoidRootPart") or
Mob:FindFirstChild("Main")
function checkChests()
for _, Chest in pairs(workspace.Dungeon:GetDescendants()) do
if (findName(Chest.Name, "chest") or (findName(Chest.Name, "_medical")
and not findName(Chest.Name, "machine") and checkHealth(.8)) or --
[[findName(Chest.Name, "_ammo") and not findName(Chest.Name, "machine") or]]
findName(Chest.Name, "locker") or findName(Chest.Name, "workbox")) and
(Chest:FindFirstChild("Interact") and
Chest:FindFirstChild("Interact"):IsA("BasePart") or
Chest:FindFirstChild("Chest") and
Chest:FindFirstChild("Chest"):IsA("BasePart")) and not
Chest:FindFirstChild("Opened") then
wait(1.47);
end
end
return true
end
function passRoom(Door)
local Part = Door:FindFirstChild("Interact") or Door:FindFirstChild("Part")
if Part == nil then
Part = Door:FindFirstChildWhichIsA("BasePart");
end
tp(HRP, Part.CFrame)--HRP.CFrame = Part.CFrame;
wait();
game.ReplicatedStorage.Ints.Regiontrig:FireServer("Door", Door);
end
function checkRoom()
local Empty = false;
local Door = nil;
for _, v in pairs(workspace.Dungeon:GetDescendants()) do
if findName(v.Name, "shrine") and v.Name ~= "Shrine" and
v:FindFirstChildWhichIsA("BasePart") and v:FindFirstChildWhichIsA("BasePart").Name
== "Interact" then
tp(HRP, v:FindFirstChildWhichIsA("BasePart").CFrame)--
HRP.CFrame = v:FindFirstChildWhichIsA("BasePart").CFrame;
wait(0.1);
v:FindFirstChildWhichIsA("BasePart").Purchase:FireServer();
wait(1);
v:Destroy();
elseif v.Name == "Midnight_Shrineend" and
v:FindFirstChild("Interact") then
tp(HRP, v:FindFirstChild("Interact").CFrame) --HRP.CFrame =
v:FindFirstChild("Interact").CFrame;
wait(0.1);
v:FindFirstChild("Interact").Purchase:FireServer();
wait(14);
v:Destroy();
elseif v:IsA("IntValue") and not v:GetAttribute("Purchased") and
v:FindFirstAncestor("Interact") and Settings.AutoBuy and
v:FindFirstAncestor("Offerings") then
local re = v.Parent.Parent.Purchase
wait(.1)
elseif Settings.AutoUseShardMachine and v.Name ==
"Machine_Shardmachine" and v:FindFirstChild("Interact") and Money.Value >=
v.Interact.Cost.Value then
tp(HRP, v.Interact.CFrame)
wait(.1)
v.Interact.Purchase:FireServer()
wait(1)
v.Name = "Used Machine_Shardmachine"
elseif Settings.AutoUseMedicalMachine and v.Name ==
"Machine_Healthmachine" and v:FindFirstChild("Interact") and
checkHealth(Settings.AutoUseMedicalMachineHP) and Money.Value >=
v.Interact.Cost.Value then
tp(HRP, v.Interact.CFrame)
wait(.1)
v.Interact.Purchase:FireServer()
wait(3)
v.Name = "Used Machine_Healthmachine"
elseif v.Name == "Nextroomind" and v.Enabled == true then
Empty = true;
Door = v.Parent;
end
end
function collectBundles()
for _, Bundle in pairs(lp.Character:GetChildren()) do
if Bundle.Name == "Pickup" and Bundle:FindFirstChild("Pickupbase") then
Bundle.Pickupbase.CFrame = HRP.CFrame
end
end
end
function getYLevel()
local Y = 1.7;
if Explosions:FindFirstChild("ExplodingBarrel") then
Y = 40;
end
return Y
end
function getPillars()
for i, v in pairs(workspace.Dungeon:GetDescendants()) do
if v:IsA("Model") then
if string.find(v.Name, "Truepillar") and
v:FindFirstChild("Interact") then
HRP.CFrame = v.Interact.CFrame
wait(0.1)
v.Interact.Purchase:FireServer()
wait(1)
elseif string.find(v.Name, "Purgepillar") and
v:FindFirstChild("Interact") then
HRP.CFrame = v.Interact.CFrame
wait(.1)
v.Interact.Purchase:FireServer()
wait(1)
v.Interact.Name = "Used"
break
end
end
end
end
local sb = lp.PlayerGui.Game.Action.Loot.Statusbar
local randomtp = true
if rs.World.Dungeondata.Location.Value == "Temp" then
function startFarm()
collectBundles();
local isRoomEmpty, Door = checkRoom();
if isRoomEmpty == true and Door ~= nil then
passRoom(Door)
end
for i,v in next, workspace.Dungeon:GetDescendants() do
if findName(v.Name, "keepsakereward") and
v:FindFirstChild("Interact") and lp.Ext:FindFirstChild("Run_Truecontained") and
lp.Ext.Run_Truecontained.Value >= 10 then
tp(HRP, v.Interact.CFrame)
wait(.1)
v.Interact.Purchase:FireServer()
wait(1)
v.Interact.Name = "Used"
end
end
for i,v in next, workspace.Dungeon:GetDescendants() do
if findName(v.Name, "purgereward") and
v:FindFirstChild("Interact") and lp.Ext:FindFirstChild("Run_Truecontained") then
tp(HRP, v.Interact.CFrame)
for i=1, lp.Ext.Run_Truecontained.Value do
wait(.1)
v.Interact.Purchase:FireServer()
end
wait(2)
v.Interact.Name = "Used"
end
end
if not lp.Ext:FindFirstChild("Run_Truecontained") or
lp.Ext.Run_Truecontained.Value == 0 then
reg:FireServer("Leave")
end
end
else
function startFarm()
collectBundles();
local closestMob, Part = getClosestMob();
local targeted = false
for i,v in next, sb:GetDescendants() do
if v:IsA("TextLabel") and findName(v.Text, "target") then
targeted = true
end
end
for _, v in pairs(workspace.Dungeon:GetDescendants()) do
if Settings.AutoUseMedicalMachine and v.Name ==
"Machine_Healthmachine" and v:FindFirstChild("Interact") and
checkHealth(Settings.AutoUseMedicalMachineHP) and Money.Value >=
v.Interact.Cost.Value then
tp(HRP, v.Interact.CFrame)
wait(.1)
v.Interact.Purchase:FireServer()
wait(2)
v.Name = "Used Machine_Healthmachine"
end
end
if targeted then
HRP.CFrame = CFrame.new(HRP.CFrame.X, HRP.CFrame.Y + 3,
HRP.CFrame.Z)
elseif Live:FindFirstChild("Junction_Heart") and randomtp then
if randomtp then
local cf = Part.CFrame
tp(HRP, CFrame.new(cf.X + math.random(-60, 60), cf.Y
+ math.random(30, 70), cf.Z + math.random(-60, 60)))--HRP.CFrame = CFrame.new(cf.X
+ math.random(-60, 60), cf.Y + math.random(30, 70), cf.Z + math.random(-60, 60))
end
if
Live:FindFirstChild("Junction_Heart"):FindFirstChild("Interact") then
tp(HRP, Part.CFrame * CFrame.new(0, 0, 3))--
HRP.CFrame = Part.CFrame * CFrame.new(0, 0, 3)
wait(.1)
Live.Junction_Heart.Interact.Purchase:FireServer();
Live.Junction_Heart.Interact.Name = "Used";
end
elseif closestMob ~= nil then
tp(HRP, Part.CFrame * CFrame.new(0, 0, 3)) --HRP.CFrame =
Part.CFrame * CFrame.new(0, 0, 3);
Attack(Part);
else
--[[local Y = getYLevel();
if Y == 40 then
--HRP.CFrame = HRP.CFrame * CFrame.new(0, Y, 0);
end]]
local isRoomEmpty, Door = checkRoom();
function Attack(lastPart)
local Distance = (HRP.Position - lastPart.Position).Magnitude;
lp.Character.Gunmain.Gearinput:FireServer(string.format("Activate%d", i),
v[1], HRP.CFrame, math.random(0, 1000))
end
end
lp.Character.Gunmain.Guninput:FireServer(
"Melee",
tick(),
HRP.CFrame,
math.random(0, 1000),
2,
{},
true
)
lastAttack = tick();
end
end
function updateMobs()
for _, Mob in pairs(workspace.Dungeon:GetDescendants()) do
if Mob:FindFirstChild("Tags") and Mob:FindFirstChild("Stats") and not
findName(Mob.Name, "barrel") and not findName(Mob.Name, "propane") and not
findName(Mob.Name, "sludge") and not findName(Mob.Name, "cannon") and not
findName(Mob.Name, "firepad") and not findName(Mob.Name, "conveyor") and not
findName(Mob.Name, "sidepress") and not findName(Mob.Name, "pressfast") and
Mob.Name ~= "Mantle_Shooter" then
Mob.Parent = Live;
elseif findName(Mob.Name, "barrel") then
if Mob:FindFirstChild("Explosivedeath") then
if #Explosions:GetChildren() <= 3 then
local Explosion = Instance.new("Folder");
Explosion.Name = "ExplodingBarrel";
Explosion.Parent = Explosions;
Debris:AddItem(Explosion, 1);
end
spawn(function()
wait(1)
if Mob and Mob:FindFirstChild("Explosivedeath") then
Mob.Explosivedeath:Destroy();
end
end)
end
end
end
for i,v in next, workspace.Live:GetChildren() do
if v:FindFirstChild("Stats") and v.Stats:FindFirstChild("Dead")
and v.Stats.Dead.Value then
v:Destroy()
end
end
end
--//Update
spawn(function()
while true do
spawn(function()
updateMobs();
end)
wait(0.17);
end
end)
--//Farm
spawn(function()
while true do
if _G.Autofarm == true then
startFarm();
end
wait();
end
end)
Money:GetPropertyChangedSignal("Value"):Connect(function()
for i,v in next, ShopItems do
if Money.Value >= v.Value then
reg:FireServer("Purchase", v)
ShopItems[i] = nil
break
end
end
end)
--//Auto Pickup
workspace.ChildAdded:Connect(function(Child)
repeat
wait()
if Child.Name == "Lootbundle" and _G.Autofarm == true then
if Child:FindFirstChild("Shard") then
Child.Shard.Purchase:FireServer()
else
rs.Ints.Interactcontrol:InvokeServer(
"Gunopen",
"Unequip",
Child:GetChildren()[1],
"Gunitem"
)
end
end
until Child.Parent == nil
end)
--//Auto Sell
if Settings.AutoSell then
spawn(function() -- Autosell
Press(lp.PlayerGui.Inventory.Buttons.Inventory.Item.Button.MouseButton1Click)
wait(.5)
Press(lp.PlayerGui.Inventory.Buttons.Exit.Exit.MouseButton1Click)
game.Lighting.Blur.Enabled = false
for _,v in pairs(lp.Guns:GetChildren()) do
if v:FindFirstChild("Slot") and v.Slot.Value == 0 then
rs.Ints.Purchasecontrol:InvokeServer("Sellgun", v)
end
end
if Settings.RarityFilterGun == nil or
Settings.RarityFilterGun == "" then
game.ReplicatedStorage.Ints.Purchasecontrol:InvokeServer("Sellgun", v)
end
end
wait()
end
rs.Ints.Purchasecontrol:InvokeServer("Sellgun", v)
end
end
if Settings.RarityFilterGear == nil or
Settings.RarityFilterGear == "" then
game.ReplicatedStorage.Ints.Purchasecontrol:InvokeServer("Sellgun", v)
end
end
wait()
end
end)
end
--//Rejoin
local dead = lp.PlayerGui.Run.Dead.Return
dead:GetPropertyChangedSignal("Visible"):Connect(function()
if dead.Visible then
wait(1.7);
reg:FireServer("Leave");
end
end)
--//Finished Run
local runend = lp.PlayerGui.Run.Runend.Return
local loctolevel = {["Outerwall"] = 1, ["Shallows"] = 1, ["Yaramo"] = 2,
["Mantle"] = 2, ["Vertigo"] = 3, ["Midnight"] = 4, ["Junction"] = 5}
runend:GetPropertyChangedSignal("Visible"):Connect(function()
if runend.Visible then
wait(1.7);
if Settings.NextRegion == false or
(rs.World.Dungeondata.Location.Value == "Junction" and Settings.TempFarm == false)
or (Settings.LeaveAtRegion ~= nil and Settings.LeaveAtRegion ~= "") and
rs.World.Dungeondata.Location.Value == Settings.LeaveAtRegion then
reg:FireServer("Leave");
else
local loc = rs.World.Dungeondata.Location.Value
local level = loctolevel[loc]
if level and Settings.Path[level] then
reg:FireServer("Votenext", Settings.Path[level])
else
reg:FireServer("Votenext")
end
end
end
end)
if sword then
local char = lp.Character
char.Gunmain.Gearinput:FireServer(
string.format("Activate%d", Settings.MeleeSlot),
lp.Sessionstats.Gearbar:FindFirstChild(sword.Name),
HRP.CFrame,
math.random(0, 1000)
)
end
end)
print("Main Started")
end