Advertisement
Jiren_0013

Anime Dimensions - Jiren Auto Farm

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