Advertisement
Zulkin

Roblox A 0ne Piece Game Dungeon/Raid Autofarm October 2022

Oct 22nd, 2022 (edited)
1,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.40 KB | Gaming | 0 0
  1. -- Rex. E#6809
  2. -- 10/22/2022
  3. -- Updated 1/23/2023
  4. -- Made for synapse
  5. -- How it works: When an enemy is in range, it dies. With specific enemies they take longer to die because of a thing called Network ownership, and they will take longer most likely due to the joint sizes on their body. An example being the gear 4 dungeon boss. Just wait a minute in the air and you'll win.
  6. -- A 0ne piece game Raid/Dungeon Autofarm. Must enter the game to use, will make loop dungeons entirely auto in the future.
  7. -- Game: https://www.roblox.com/games/8396586868/x5-A-0ne-Piece-Game
  8. local Players = game:GetService("Players")
  9. local Player = Players.LocalPlayer
  10. local Enemies = workspace.Entities
  11. local RenderStepped = game:GetService("RunService").RenderStepped
  12. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  13. local Stepped = game:GetService("RunService").Stepped
  14. local Char = Player.Character
  15. local Root = Char:FindFirstChild("HumanoidRootPart")
  16. local TweenService = game:GetService("TweenService")
  17. local Remotes = ReplicatedStorage.Remotes
  18. local RequestAbility = Remotes.requestAbility
  19. local Clip = false
  20. local DungeonSafeFrame = CFrame.new(136.988327, 15304.5391, 1494.77112)
  21. local FarmType = "Auto" -- Farmtype Weapon is for xp and more reliable farm, while Farmtype auto is for sitting in the air and waiting, not getting much xp.
  22. local WeaponTypes = {DF = "Devil Fruit", SW = "Sword Style", FS = "Fighting Style"}
  23. local WeaponType = SW
  24. _G.AutoSafepoint = true -- Networkowner reliance is a bitch.
  25.  
  26. function SetHp()
  27.     for i,Enemy in pairs(Enemies:GetChildren()) do
  28.         if Players:GetPlayerFromCharacter(Enemy) == nil or false then
  29.             if Enemy:FindFirstChildOfClass("Humanoid") then
  30.                 local Hum = Enemy:FindFirstChildOfClass("Humanoid")
  31.                 if _G.AutoSafepoint then
  32.                     Hum.Health = 0
  33.                     --Hum.Health = 5
  34.                 else
  35.                     if Enemy:FindFirstChild("HumanoidRootPart") then
  36.                         if isnetworkowner(Enemy:FindFirstChild("HumanoidRootPart")) == false then
  37.                             Root.CFrame = Enemy:FindFirstChild("HumanoidRootPart").CFrame
  38.                             Hum.Health = 0
  39.                             --wait()
  40.                             --Hum.Health = 5
  41.                             Root.CFrame = DungeonSafeFrame
  42.                         end
  43.                     end
  44.                 end
  45.             end
  46.         end
  47.     end
  48. end
  49.  
  50. function MakeTween()
  51.    local Finish = {CFrame = CFrame.new(136.988327, 15304.5391, 1494.77112)}
  52.    local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In)
  53.    local Tween = TweenService:Create(Root,Info,Finish)
  54.    Tween:Play()
  55.    Tween.Completed:Connect(function()
  56.        repeat RenderStepped:Wait()
  57.            if _G.AutoSafepoint then
  58.                Root.CFrame = DungeonSafeFrame
  59.                Root.Anchored = true
  60.            else
  61.                
  62.            end
  63.        until nil
  64.    end)
  65. end
  66.  
  67. function NoclipLoop()
  68.     if Clip == false and Player.Character ~= nil then
  69.         for _, child in pairs(Player.Character:GetDescendants()) do
  70.             if child:IsA("BasePart") and child.CanCollide == true and child.Name ~= floatName then
  71.                 child.CanCollide = false
  72.             end
  73.         end
  74.     end
  75. end
  76.  
  77. function firerequest(Type,Key)
  78.     pcall(function()
  79.         RequestAbility:FireServer(Type,Key,Root.CFrame,Root,5)
  80.     end)
  81. end
  82.  
  83. function AutoHit()
  84.     for i,Enemy in pairs(Enemies:GetChildren()) do
  85.         if Players:GetPlayerFromCharacter(Enemy) == nil or false then
  86.             for i,Hitbox in pairs(Char:GetDescendants()) do
  87.                 if Hitbox.Name == "Handle" or Hitbox.Name == "Blade" and WeaponType == SW then
  88.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 0)
  89.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 1)
  90.                 elseif Hitbox.Name == "Right Arm" or Hitbox.Name == "Left Arm" or Hitbox.Name == "Torso" and WeaponType == DF then
  91.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 0)
  92.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 1)
  93.                 elseif Hitbox.Name == "Right Arm" or Hitbox.Name == "Left Arm" or Hitbox.Name == "Right Leg" or Hitbox.Name == "Left Leg" or Hitbox.Name == "Torso" and WeaponType == FS  then
  94.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 0)
  95.                     firetouchinterest(Hitbox, Enemy:FindFirstChild("HumanoidRootPart"), 1)
  96.                 end
  97.             end
  98.         end
  99.     end
  100.     if WeaponType == "FS" then
  101.         firerequest("Fighting Style", "Q")
  102.         firerequest("Fighting Style", "E")
  103.         firerequest("Fighting Style", "R")
  104.     elseif WeaponType == "SW" then
  105.         firerequest("Sword Style", "Q")
  106.         firerequest("Sword Style", "R")
  107.         firerequest("Sword Style", "F")
  108.     elseif WeaponType == "DF" then
  109.         firerequest("Devil Fruit", "Q")
  110.         firerequest("Devil Fruit", "E")
  111.         firerequest("Devil Fruit", "R")
  112.         firerequest("Devil Fruit", "F")
  113.     end
  114. end
  115.  
  116. if game.PlaceId == 9812430518 then
  117.     MakeTween()
  118.     Noclipping = Stepped:Connect(NoclipLoop)
  119. end
  120.  
  121. while RenderStepped:wait() do
  122.     if FarmType == "Auto" then
  123.         SetHp()
  124.     elseif FarmType == "Weapon" then
  125.         AutoHit()
  126.     end
  127.     if game.PlaceId == 9812430518 then
  128.         --Root.Anchored = false
  129.         --MakeTween()
  130.         --Root.CFrame = Root.CFrame
  131.     end
  132. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement