Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game:IsLoaded()
- -- Auto farm module made by Jiren. You can use in most games
- getgenv().FarmN = true -- Enable/Disable
- getgenv().TWSpeed = 100 -- Tween speed (The Higher the Faster, the Lower the Slower)
- getgenv().AutoFarmModule = {
- Bot, -- Return bot
- GetWork = game.Workspace.Folders.Monsters, -- Workspace path
- GetMode = 1, -- 1 = GetChildren(), 2 = GetDescendants()
- FarmMode = 2, -- 1 = Behind, 2 = Under, 3 = Over
- Distance = 8, -- Distance
- Checker = function(noob)
- return noob:FindFirstChild("HumanoidRootPart") and noob:FindFirstChild("Monster").Health > 0 and noob:FindFirstChild("EnemyHealthBarGui") and noob ~= nil
- end,
- BotHum = function(noob)
- return noob.HumanoidRootPart
- end,
- IsTweening = true, -- Return true if tweening
- TweenCompleted = function()
- -- Check if tween completed
- IsTweening = false
- end,
- -- Custom functions
- HideName = spawn(function()
- while getgenv().FarmN do wait()
- pcall(function()
- game.Workspace.Folders.Players[game.Players.LocalPlayer.Name].Head.PlayerHealthBarGui:Destroy()
- end)
- end
- end),
- AutoRetry = spawn(function()
- while getgenv().FarmN do wait()
- pcall(function()
- local Retry = "RetryDungeon"
- local Event = game:GetService("ReplicatedStorage").RemoteEvents.MainRemoteEvent
- Event:FireServer(Retry)
- end)
- end
- end),
- AutoPunch = spawn(function()
- local count = 1
- local RenderWait = function()
- return game:GetService("RunService").RenderStepped:Wait()
- end
- while getgenv().FarmN do RenderWait()
- repeat wait() until AutoFarmModule.Bot
- local UseSkill = "UseSkill"
- if count <= 3 then
- count = count + 1
- elseif count >= 4 then
- count = 1
- end
- local NoobTable = {
- ["hrpCFrame"] = CFrame.new(AutoFarmModule.Bot.HumanoidRootPart.Position),
- ["attackNumber"] = count
- }
- local BasicOfBasic = "BasicAttack"
- local Event = game:GetService("ReplicatedStorage").RemoteEvents.MainRemoteEvent
- Event:FireServer(UseSkill, NoobTable, BasicOfBasic)
- end
- end),
- AutoSkill = spawn(function()
- local RenderWait = function()
- return game:GetService("RunService").RenderStepped:Wait()
- end
- local PressSkillKey = function(key)
- local VIM = game:GetService("VirtualInputManager")
- VIM:SendKeyEvent(true, Enum.KeyCode[key], false, game)
- wait()
- VIM:SendKeyEvent(false, Enum.KeyCode[key], false, game)
- end
- --https://developer.roblox.com/en-us/api-reference/enum/KeyCode -- All keys here, If you want to make a script with auto press
- while getgenv().FarmN do RenderWait()
- pcall(function()
- if not IsTweening and AutoFarmModule.Checker(AutoFarmModule.Bot) then
- local keylist = {"One", "Two", "Three", "Four"}
- local randomskill = keylist[math.random(1, #keylist)]
- PressSkillKey(randomskill)
- end
- end)
- end
- end)
- }
- -- Yes
- function RenderWait()
- return game:GetService("RunService").RenderStepped:Wait()
- end
- function GetBot(Child, Mode)
- local getChild
- if Mode == 1 then
- getChild = Child:GetChildren()
- elseif Mode == 2 then
- getChild = Child:GetDescendants()
- end
- local Dist, Bot = math.huge
- for i = 1,#getChild do
- local v = getChild[i]
- local DistFromChar = game.Players.LocalPlayer:DistanceFromCharacter(AutoFarmModule.BotHum(v).Position)
- if DistFromChar < Dist and AutoFarmModule.Checker(v) then
- Dist = DistFromChar
- Bot = v
- end
- end
- return Bot
- end
- function Tween(pos, targetPos, targetCFrame)
- if pos == "Hum" then
- pos = game:GetService("Players").LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Position
- end
- local tween_s = game:service"TweenService"
- local info = TweenInfo.new((targetPos - pos).Magnitude/TWSpeed, Enum.EasingStyle.Linear)
- local tween, err = pcall(function()
- local tween = tween_s:Create(game:GetService("Players").LocalPlayer.Character["HumanoidRootPart"], info, {CFrame = targetCFrame})
- tween:Play()
- tween.Completed:Wait()
- AutoFarmModule.TweenCompleted();
- end)
- if not tween then return err end
- end
- function AutoFarmer(Mode, Dist)
- local Distance
- local Noob = GetBot(AutoFarmModule.GetWork, AutoFarmModule.GetMode)
- AutoFarmModule.Bot = GetBot(AutoFarmModule.GetWork, AutoFarmModule.GetMode)
- if AutoFarmModule.FarmMode == 1 then
- Distance = Dist
- AutoFarmModule.IsTweening = true
- Tween("Hum", AutoFarmModule.BotHum(Noob).Position, AutoFarmModule.BotHum(Noob).CFrame - AutoFarmModule.BotHum(Noob).CFrame.lookVector * Distance)
- wait(game.Players.LocalPlayer:DistanceFromCharacter(AutoFarmModule.BotHum(Noob).Position)/TWSpeed)
- elseif AutoFarmModule.FarmMode == 2 then
- Distance = -Dist
- AutoFarmModule.IsTweening = true
- Tween("Hum", AutoFarmModule.BotHum(Noob).Position, AutoFarmModule.BotHum(Noob).CFrame * CFrame.Angles(math.rad(Distance > 0 and -90 or 90),0,0) + Vector3.new(0,Distance,0))
- wait(game.Players.LocalPlayer:DistanceFromCharacter(AutoFarmModule.BotHum(Noob).Position)/TWSpeed)
- elseif AutoFarmModule.FarmMode == 3 then
- Distance = Dist
- AutoFarmModule.IsTweening = true
- Tween("Hum", AutoFarmModule.BotHum(Noob).Position, AutoFarmModule.BotHum(Noob).CFrame * CFrame.Angles(math.rad(Distance > 0 and -90 or 90),0,0) + Vector3.new(0,Distance,0))
- wait(game.Players.LocalPlayer:DistanceFromCharacter(AutoFarmModule.BotHum(Noob).Position)/TWSpeed)
- end
- end
- spawn(function()
- while getgenv().FarmN do RenderWait()
- pcall(function()
- AutoFarmer(AutoFarmModule.FarmMode, AutoFarmModule.Distance)
- end)
- end
- end)
- spawn(function()
- game:GetService("RunService"):UnbindFromRenderStep("NoclipHoHoHo")
- if getgenv().FarmN then
- game:GetService("RunService"):BindToRenderStep("NoclipHoHoHo",0,function()
- if not getgenv().FarmN then return end
- if not game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid") then return end
- game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid"):ChangeState(11)
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement