Jiren_0013

Anime Dimensions - Jiren Auto Farm 2

Jul 4th, 2021 (edited)
4,624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.16 KB | None | 0 0
  1. repeat wait() until game:IsLoaded()
  2. -- Auto farm module made by Jiren. You can use in most games
  3.  
  4. getgenv().FarmN = true -- Enable/Disable
  5. getgenv().TWSpeed = 200 -- Tween speed (The Higher the Faster, the Lower the Slower)
  6. getgenv().AutoFarmModule = {
  7.     Bot, -- Return bot
  8.     GetWork = game.Workspace.Folders.Monsters, -- Workspace path
  9.     GetMode = 1, -- 1 = GetChildren(), 2 = GetDescendants()
  10.     FarmMode = 2, -- 1 = Behind, 2 = Under, 3 = Over
  11.     Distance = 7, -- Distance
  12.     Checker = function(noob)
  13.         return noob:FindFirstChild("HumanoidRootPart") and noob:FindFirstChild("Monster").Health > 0 and noob:FindFirstChild("EnemyHealthBarGui") and noob ~= nil
  14.     end,
  15.     BotHum = function(noob)
  16.         return noob.HumanoidRootPart
  17.     end,
  18.     CheckDistance = 1000, -- Stop teleport if distance is over
  19.     IsTweening = true, -- Return true if tweening
  20.     TweenCompleted = function()
  21.        -- Check if tween completed
  22.        IsTweening = false
  23.     end,
  24.     -- Custom functions
  25.     HideName = spawn(function()
  26.         while getgenv().FarmN do wait()
  27.             pcall(function()
  28.                 game.Workspace.Folders.Players[game.Players.LocalPlayer.Name].Head.PlayerHealthBarGui:Destroy()
  29.             end)
  30.         end
  31.     end),
  32.     AutoRetry = spawn(function()
  33.         while getgenv().FarmN do wait()
  34.             pcall(function()
  35.                 local Retry = "RetryDungeon"
  36.                 local Event = game:GetService("ReplicatedStorage").RemoteEvents.MainRemoteEvent
  37.                 Event:FireServer(Retry)
  38.             end)
  39.         end
  40.     end),
  41.     AutoPunch = spawn(function()
  42.         local count = 1      
  43.         repeat wait() until AutoFarmModule.Bot
  44.         local UseSkill = "UseSkill"
  45.         local Keylist = {1, 2, 3, 4}
  46.         while getgenv().FarmN do wait(0.1)
  47.             pcall(function()
  48.                 local Local = game.Players.LocalPlayer.Character.HumanoidRootPart
  49.                 local RandomAttack = Keylist[math.random(1, #Keylist)]
  50.                 local NoobTable = {
  51.                     ["hrpCFrame"] = Local.CFrame - Local.CFrame.lookVector * -AutoFarmModule.Distance,
  52.                     ["attackNumber"] = RandomAttack
  53.                 }
  54.                 local BasicOfBasic = "BasicAttack"
  55.                 local Event = game:GetService("ReplicatedStorage").RemoteEvents.MainRemoteEvent
  56.                 Event:FireServer(UseSkill, NoobTable, BasicOfBasic)
  57.             end)
  58.         end
  59.     end),
  60.     AutoSkill = spawn(function()
  61.         local PressSkillKey = function(key)
  62.             local VIM = game:GetService("VirtualInputManager")
  63.             VIM:SendKeyEvent(true, Enum.KeyCode[key], false, game)
  64.             wait()
  65.             VIM:SendKeyEvent(false, Enum.KeyCode[key], false, game)
  66.         end
  67.         --https://developer.roblox.com/en-us/api-reference/enum/KeyCode -- All keys chere, If you want to make a script with auto press
  68.         while getgenv().FarmN do wait()
  69.             pcall(function()
  70.                 if not IsTweening then
  71.                     local Keylist = {"One", "Two", "Three", "Four"}
  72.                     local Randomskill = Keylist[math.random(1, #Keylist)]
  73.                     PressSkillKey(Randomskill)
  74.                 end
  75.             end)
  76.         end
  77.     end),
  78.     CheckSukunaDistance = spawn(function()
  79.         while getgenv().FarmN do wait()
  80.             pcall(function()
  81.                 local sukuna = AutoFarmModule.Bot
  82.                 local checkdist = (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - sukuna.HumanoidRootPart.Position).Magnitude
  83.                 if checkdist > AutoFarmModule.CheckDistance and sukuna.Name == "King of Curses" then
  84.                     local TpCircle = game.Workspace.GameMap["Curse Dimension"].CurseTeleportCircle
  85.                     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(TpCircle.Position)
  86.                 end
  87.             end)
  88.         end
  89.     end),
  90. }
  91.  
  92. -- Yes
  93.  
  94. function RenderWait()
  95.     return game:GetService("RunService").RenderStepped:Wait()
  96. end
  97.  
  98. function GetBot(Child, Mode)
  99.     local getChild
  100.     if Mode == 1 then
  101.         getChild = Child:GetChildren()
  102.     elseif Mode == 2 then
  103.         getChild = Child:GetDescendants()
  104.     end
  105.     local Dist, Bot = math.huge
  106.     for i = 1,#getChild do
  107.         local v = getChild[i]
  108.         local DistFromChar = game.Players.LocalPlayer:DistanceFromCharacter(AutoFarmModule.BotHum(v).Position)
  109.         if DistFromChar < Dist and AutoFarmModule.Checker(v) then
  110.             Dist = DistFromChar
  111.             Bot = v
  112.         end
  113.     end
  114.     return Bot
  115. end
  116.  
  117. function SpawnPcall(f)
  118.     spawn(function()
  119.         pcall(f)()
  120.     end)
  121. end
  122.  
  123. function Tween(pos, targetPos, targetCFrame)
  124.     if pos == "Hum" then
  125.         pos = game:GetService("Players").LocalPlayer.Character:FindFirstChild("HumanoidRootPart").Position
  126.     end
  127.     local tween_s = game:service"TweenService"
  128.     local info = TweenInfo.new((targetPos - pos).Magnitude/TWSpeed, Enum.EasingStyle.Linear)
  129.     local checkdist = (pos - targetPos).Magnitude
  130.     if checkdist > AutoFarmModule.CheckDistance then
  131.         return
  132.     end
  133.     local tween, err = pcall(function()
  134.         local tween = tween_s:Create(game:GetService("Players").LocalPlayer.Character["HumanoidRootPart"], info, {CFrame = targetCFrame})
  135.         tween:Play()
  136.         tween.Completed:Wait()
  137.         AutoFarmModule.TweenCompleted();  
  138.     end)
  139.     if not tween then
  140.         return err
  141.     end
  142. end
  143.  
  144. function AutoFarmer(Mode, Dist)
  145.     local Distance
  146.     local Noob = GetBot(AutoFarmModule.GetWork, AutoFarmModule.GetMode)
  147.     AutoFarmModule.Bot = GetBot(AutoFarmModule.GetWork, AutoFarmModule.GetMode)
  148.     if AutoFarmModule.FarmMode == 1 then
  149.         Distance = Dist
  150.         AutoFarmModule.IsTweening = true
  151.         Tween("Hum", AutoFarmModule.BotHum(Noob).Position, AutoFarmModule.BotHum(Noob).Crame - AutoFarmModule.BotHum(Noob).CFrame.lookVector * Distance)
  152.     elseif AutoFarmModule.FarmMode == 2 then
  153.         Distance = -Dist
  154.         AutoFarmModule.IsTweening = true
  155.         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))
  156.     elseif AutoFarmModule.FarmMode == 3 then
  157.         Distance = Dist
  158.         AutoFarmModule.IsTweening = true
  159.         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))
  160.     end
  161. end
  162.  
  163. spawn(function()
  164.     while getgenv().FarmN do RenderWait()
  165.         pcall(function()
  166.             AutoFarmer(AutoFarmModule.FarmMode, AutoFarmModule.Distance)
  167.         end)
  168.     end
  169. end)
  170.  
  171. spawn(function()
  172.     game:GetService("RunService"):UnbindFromRenderStep("NoclipHoHoHo")
  173.     if getgenv().FarmN then
  174.         game:GetService("RunService"):BindToRenderStep("NoclipHoHoHo",0,function()
  175.             if not getgenv().FarmN then return end
  176.             if not game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid") then return end
  177.             game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid"):ChangeState(11)
  178.         end)
  179.     end
  180. end)
Add Comment
Please, Sign In to add comment