Advertisement
Porry

Ro Ghoul Script - Auto Farm - Touka Farm/Better Auto Save/Credits to z4gs

Sep 29th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.26 KB | None | 0 0
  1. local gui = loadstring(game:HttpGetAsync("https://raw.githubusercontent.com/z4gs/scripts/master/testtttt.lua"))():AddWindow("Ro-Ghoul", {
  2.     main_color = Color3.fromRGB(0,0,0),
  3.     min_size = Vector2.new(373, 340),
  4.     can_resize = false
  5. })
  6.  
  7. local get = setmetatable({}, {
  8.     __index = function(a, b)
  9.         return game:GetService(b) or game[b]
  10.     end
  11. })
  12.  
  13. local tab1, tab2, tab3, tab4 = gui:AddTab("Main"), gui:AddTab("Farm Options"), gui:AddTab("Trainer"), gui:AddTab("Misc")
  14. local btn, btn2, btn3, key, nmc, trainers, labels
  15. local findobj, findobjofclass, waitforobj, fire, invoke = get.FindFirstChild, get.FindFirstChildOfClass, get.WaitForChild, Instance.new("RemoteEvent").FireServer, Instance.new("RemoteFunction").InvokeServer
  16. local player = get.Players.LocalPlayer
  17.  
  18. repeat wait() until player:FindFirstChild("PlayerFolder")
  19.  
  20. local team, remotes, stat = player.PlayerFolder.Customization.Team.Value, get.ReplicatedStorage.Remotes, player.PlayerFolder.StatsFunction
  21. local oldtick, farmtick = 0, 0
  22. local camera = workspace.CurrentCamera
  23. local myData = (isfolder("Porry") and isfile("Porry/data.json")) and game:GetService("HttpService"):JSONDecode(readfile("Porry/data.json")) or {
  24.     Skills = {
  25.         E = false,
  26.         F = false,
  27.         C = false,
  28.         R = false
  29.     },
  30.     Boss = {
  31.         ["Gyakusatsu"] = false,
  32.         ["Eto Yoshimura"] = false,
  33.         ["Koutarou Amon"] = false,
  34.         ["Nishiki Nishio"] = false,
  35.         ["Touka Kirishima"] = false
  36.     },
  37.     DistanceFromNpc = 5,
  38.     DistanceFromBoss = 8,
  39.     TeleportSpeed = 150,
  40.     ReputationFarm = false,
  41.     ReputationCashout = false,
  42.     AutoKickWhitelist = ""
  43. }
  44.  
  45. if not isfolder("Porry") then
  46.     makefolder("Porry")
  47. end
  48.  
  49.  
  50. function UpdateSave()
  51.     print_table(myData)
  52.     writefile("Porry/data.json", game:GetService("HttpService"):JSONEncode(myData))
  53. end
  54. function print_table(node)
  55.     local cache, stack, output = {},{},{}
  56.     local depth = 1
  57.     local output_str = "{\n"
  58.  
  59.     while true do
  60.         local size = 0
  61.         for k,v in pairs(node) do
  62.             size = size + 1
  63.         end
  64.  
  65.         local cur_index = 1
  66.         for k,v in pairs(node) do
  67.             if (cache[node] == nil) or (cur_index >= cache[node]) then
  68.  
  69.                 if (string.find(output_str,"}",output_str:len())) then
  70.                     output_str = output_str .. ",\n"
  71.                 elseif not (string.find(output_str,"\n",output_str:len())) then
  72.                     output_str = output_str .. "\n"
  73.                 end
  74.  
  75.                 -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  76.                 table.insert(output,output_str)
  77.                 output_str = ""
  78.  
  79.                 local key
  80.                 if (type(k) == "number" or type(k) == "boolean") then
  81.                     key = "["..tostring(k).."]"
  82.                 else
  83.                     key = "['"..tostring(k).."']"
  84.                 end
  85.  
  86.                 if (type(v) == "number" or type(v) == "boolean") then
  87.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = "..tostring(v)
  88.                 elseif (type(v) == "table") then
  89.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = {\n"
  90.                     table.insert(stack,node)
  91.                     table.insert(stack,v)
  92.                     cache[node] = cur_index+1
  93.                     break
  94.                 else
  95.                     output_str = output_str .. string.rep('\t',depth) .. key .. " = '"..tostring(v).."'"
  96.                 end
  97.  
  98.                 if (cur_index == size) then
  99.                     output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  100.                 else
  101.                     output_str = output_str .. ","
  102.                 end
  103.             else
  104.                 -- close the table
  105.                 if (cur_index == size) then
  106.                     output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  107.                 end
  108.             end
  109.  
  110.             cur_index = cur_index + 1
  111.         end
  112.  
  113.         if (size == 0) then
  114.             output_str = output_str .. "\n" .. string.rep('\t',depth-1) .. "}"
  115.         end
  116.  
  117.         if (#stack > 0) then
  118.             node = stack[#stack]
  119.             stack[#stack] = nil
  120.             depth = cache[node] == nil and depth + 1 or depth - 1
  121.         else
  122.             break
  123.         end
  124.     end
  125.  
  126.     -- This is necessary for working with HUGE tables otherwise we run out of memory using concat on huge strings
  127.     table.insert(output,output_str)
  128.     output_str = table.concat(output)
  129.  
  130.     print(output_str)
  131. end
  132.  
  133.  
  134.  
  135. local array = {
  136.     boss = {
  137.         ["Gyakusatsu"] = 1250,
  138.         ["Eto Yoshimura"] = 1250,
  139.         ["Koutarou Amon"] = 750,
  140.         ["Nishiki Nishio"] = 250,
  141.         ["Touka Kirishima"] = 250
  142.     },
  143.  
  144.     npcs = {["Aogiri Members"] = "GhoulSpawns", Investigators = "CCGSpawns", Humans = "HumanSpawns"},
  145.  
  146.     stages = {"One", "Two", "Three", "Four", "Five", "Six"},
  147.  
  148.     skills = {
  149.         E = player.PlayerFolder.Special1CD,
  150.         F = player.PlayerFolder.Special3CD,
  151.         C = player.PlayerFolder.SpecialBonusCD,
  152.         R = player.PlayerFolder.Special2CD
  153.     }
  154. }
  155.  
  156. tab1:AddLabel("Target")
  157.  
  158. if myData.targ then
  159.     array.targ = myData.targ
  160. end
  161.  
  162. local drop = tab1:AddDropdown("Select", function(opt)
  163.     array.targ = array.npcs[opt]
  164.     myData.targ = array.npcs[opt]
  165.     UpdateSave()
  166. end)
  167.  
  168.  
  169. if myData.Start then
  170.     array.autofarm = myData.Start
  171. end
  172.  
  173. btn = tab1:AddButton("Start", function()
  174.     if not array.autofarm then
  175.         if key then
  176.             btn.Text, array.autofarm = "Stop", true
  177.             myData.Start = array.autofarm
  178.             UpdateSave()
  179.             local farmtick = tick()
  180.             while array.autofarm do
  181.                 labels("tfarm", "Time elapsed: "..os.date("!%H:%M:%S", tick() - farmtick))
  182.                 wait(1)
  183.             end
  184.         else
  185.             player:Kick("Failed to get the Remote key, please try to execute the script again")
  186.         end
  187.     else
  188.         btn.Text, array.autofarm, array.died = "Start", false, false
  189.         myData.Start = array.autofarm
  190.         UpdateSave()
  191.     end
  192. end)
  193.  
  194.  
  195.  
  196. local function format(number)
  197.     local i, k, j = tostring(number):match("(%-?%d?)(%d*)(%.?.*)")
  198.     return i..k:reverse():gsub("(%d%d%d)", "%1,"):reverse()..j
  199. end
  200.  
  201. labels = setmetatable({
  202.     text = {label = tab1:AddLabel("")},
  203.     tfarm = {label = tab1:AddLabel("")},
  204.     space = {label = tab1:AddLabel("")},
  205.     Quest = {prefix = "Current Quest: ", label = tab1:AddLabel("Current Quest: None")},
  206.     Yen = {prefix = "Yen: ", label = tab1:AddLabel("Yen: 0"), value = 0, oldval = player.PlayerFolder.Stats.Yen.Value},
  207.     RC = {prefix = "RC: ", label = tab1:AddLabel("RC: 0"), value = 0, oldval = player.PlayerFolder.Stats.RC.Value},
  208.     Kills = {prefix = "Kills: ", label = tab1:AddLabel("Kills: 0"), value = 0}
  209. }, {
  210.     __call = function (self, typ, newv, oldv)
  211.         if typ and newv then
  212.             local object = self[typ]
  213.             if type(newv) == "number" then
  214.                 object.value = object.value + newv
  215.                 object.label.Text = object.prefix..format(object.value)
  216.                 if oldv then
  217.                     object.oldval = oldv
  218.                 end
  219.             elseif object.prefix then
  220.                 object.label.Text = object.prefix..newv
  221.             else
  222.                 object.label.Text = newv
  223.             end
  224.             return
  225.         end
  226.         for i,v in pairs(labels) do
  227.             v.value = 0
  228.             v.label.Text = v.prefix.."0"
  229.         end
  230.     end
  231. })
  232.  
  233. local function getLabel(la)
  234.     return labels[la].value and labels[la].value or labels[la].label.Text
  235. end
  236.  
  237. btn3 = tab1:AddButton("Reset", function() labels() end)
  238.  
  239. if team == "CCG" then tab2:AddLabel("Quinque Stage") else tab2:AddLabel("Kagune Stage") end
  240.  
  241. local drop2 = tab2:AddDropdown("[ 1 ]", function(opt)
  242.     array.stage = array.stages[tonumber(opt)]
  243. end)
  244.  
  245. array.stage = "One"
  246.  
  247. tab2:AddSwitch("Reputation Farm", function(bool)
  248.     myData.ReputationFarm = bool
  249.     UpdateSave()
  250. end):Set(myData.ReputationFarm)
  251.  
  252. tab2:AddSwitch("Auto Reputation Cashout", function(bool)
  253.     myData.ReputationCashout = bool
  254.     UpdateSave()
  255. end):Set(myData.ReputationCashout)
  256.  
  257. for i,v in pairs(array.boss) do
  258.     tab2:AddSwitch(i.." Boss Farm ".."(".."lvl "..v.."+)", function(bool)
  259.         myData.Boss[i] = bool
  260.         UpdateSave()
  261.     end):Set(myData.Boss[i])
  262. end
  263.  
  264. tab2:AddSlider("TP Speed", function(x)
  265.     myData.TeleportSpeed = x
  266.     UpdateSave()
  267. end, {min = 90, max = 250}):Set(45)
  268.  
  269. tab2:AddSlider("Distance from NPC", function(x)
  270.     myData.DistanceFromNpc = x * -1
  271.     UpdateSave()
  272. end, {min = 0, max = 8}):Set(65)
  273.  
  274. tab2:AddSlider("Distance from Bosses", function(x)
  275.     myData.DistanceFromBoss = x * -1
  276.     UpdateSave()
  277. end, {min = 0, max = 15}):Set(55)
  278.  
  279. labels.p = {label = tab3:AddLabel("Current trainer: "..player.PlayerFolder.Trainers[team.."Trainer"].Value)}
  280.  
  281. local progress = tab3:AddSlider("Progress", nil, {min = 0, max = 100, readonly = true})
  282.  
  283. progress:Set(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value)
  284.  
  285. player.PlayerFolder.Trainers[team.."Trainer"].Changed:connect(function()
  286.     labels("p", "Current trainer: "..player.PlayerFolder.Trainers[team.."Trainer"].Value)
  287.     progress:Set(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value)
  288. end)
  289.  
  290. if myData.Trainer then
  291.     array.trainer = myData.Trainer
  292. end
  293.  
  294. btn2 = tab3:AddButton("Start", function()
  295.     if not array.trainer then
  296.         array.trainer, btn2.Text = true, "Stop"
  297.         myData.Trainer = array.trainer
  298.         UpdateSave()
  299.         local connection, time
  300.  
  301.         while array.trainer do
  302.             if connection and connection.Connected then
  303.                 connection:Disconnect()
  304.             end
  305.            
  306.             local tkey, result
  307.  
  308.             connection = player.Backpack.DescendantAdded:Connect(function(obj)
  309.                 if tostring(obj) == "TSCodeVal" and obj:IsA("StringValue") then
  310.                     tkey = obj.Value
  311.                 end
  312.             end)
  313.            
  314.             result = invoke(remotes.Trainers.RequestTraining)
  315.  
  316.             if result == "TRAINING" then
  317.                 for i,v in pairs(workspace.TrainingSessions:GetChildren()) do
  318.                     if waitforobj(v, "Player").Value == player then
  319.                         fire(waitforobj(v, "Comm"), "Finished", tkey, false)
  320.                         break
  321.                     end
  322.                 end
  323.             elseif result == "TRAINING COMPLETE" then
  324.                 labels("time", "Switching to other trainer...")
  325.                 for i,v in pairs(player.PlayerFolder.Trainers:GetDescendants()) do
  326.                     if table.find(trainers, v.Name) and findobj(v, "Progress") and tonumber(v.Progress.Value) < 100 and tonumber(player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Value) == 100 then
  327.                         invoke(remotes.Trainers.ChangeTrainer, v.Name)
  328.                         wait(1.5)
  329.                     end
  330.                 end
  331.             else
  332.                 labels("time", "Time until the next training: "..result)
  333.             end
  334.             wait(1)
  335.         end
  336.         labels("time", "")
  337.     else
  338.         array.trainer, btn2.Text = false, "Start"
  339.         myData.Trainer = array.trainer
  340.         UpdateSave()
  341.     end
  342. end)
  343.  
  344.  
  345.  
  346. labels.time = {label = tab3:AddLabel("")}
  347.  
  348. tab4:AddSwitch("Auto add kagune/quinque stats", function(bool) array.weapon = bool end)
  349. tab4:AddSwitch("Auto add durability stats", function(bool) array.dura = bool end)
  350. tab4:AddSwitch("Auto kick", function(bool) array.kick = bool end)
  351. tab4:AddLabel("Auto kick whitelist (type 1 name per line)")
  352.  
  353. local console = tab4:AddConsole({
  354.     ["y"] = 50,
  355.     ["source"] = "Text",
  356. })
  357.  
  358. console:Set(myData.AutoKickWhitelist)
  359.  
  360. console:OnChange(function(newtext)
  361.     myData.AutoKickWhitelist = newtext
  362.     UpdateSave()
  363. end)
  364.  
  365. for i,v in pairs(array.skills) do
  366.     tab4:AddSwitch("Auto use "..i.." skill (on bosses)", function(bool)
  367.         myData.Skills[i] = bool
  368.         UpdateSave()
  369.     end):Set(myData.Skills[i])
  370. end
  371.  
  372. do
  373.     local count = 0
  374.     for i,v in pairs(player.PlayerGui.HUD.StagesFrame.InfoScroll:GetChildren()) do
  375.         if v.ClassName == "Frame" and v.Name ~= "Example" then
  376.             count = count + 1
  377.             drop2:Add(count)
  378.         end
  379.     end
  380. end
  381.  
  382. for i,v in pairs(array.npcs) do drop:Add(i) end
  383.  
  384. tab1:Show()
  385.  
  386. local function tp(pos)
  387.     if array.died then
  388.         player.Character.HumanoidRootPart.CFrame = pos
  389.         array.died = false
  390.         return
  391.     end
  392.  
  393.     local val = Instance.new("CFrameValue")
  394.     val.Value = player.Character.HumanoidRootPart.CFrame
  395.  
  396.     local tween = game:GetService("TweenService"):Create(
  397.         val,
  398.         TweenInfo.new((player.Character.HumanoidRootPart.Position - pos.p).magnitude / myData.TeleportSpeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0),
  399.         {Value = pos}
  400.     )
  401.  
  402.     tween:Play()
  403.  
  404.     local completed
  405.     tween.Completed:Connect(function()
  406.         completed = true
  407.     end)
  408.  
  409.     while not completed do
  410.         if array.found or not array.autofarm or player.Character.Humanoid.Health <= 0 then tween:Cancel() break end
  411.         player.Character.HumanoidRootPart.CFrame = val.Value
  412.         task.wait()
  413.     end
  414.  
  415.     val:Destroy()
  416. end
  417.  
  418. local function getNPC()
  419.     local nearestnpc, nearest = nil, math.huge
  420.  
  421.     if myData.Boss.Gyakusatsu and tonumber(player.PlayerFolder.Stats.Level.Value) > array.boss["Gyakusatsu"] and findobj(workspace.NPCSpawns["GyakusatsuSpawn"], "Gyakusatsu") then
  422.         local lowesthealth, lowestNpcModel = math.huge, nil
  423.  
  424.         for i,v in pairs(workspace.NPCSpawns["GyakusatsuSpawn"]:GetChildren()) do
  425.             if v.Name ~= "Mob" and findobj(v, "Humanoid") and v.Humanoid.Health < lowesthealth then
  426.                 lowesthealth = v.Humanoid.Health
  427.                 lowestNpcModel = v
  428.             end
  429.         end
  430.  
  431.         if not lowestNpcModel then
  432.             return workspace.NPCSpawns.GyakusatsuSpawn.Gyakusatsu
  433.         end
  434.        
  435.         return lowestNpcModel
  436.     end
  437.  
  438.     for i,v in pairs(workspace.NPCSpawns:GetChildren()) do
  439.         local npc = findobjofclass(v, "Model")
  440.  
  441.         if npc and findobj(npc, "Head") and not findobj(npc, "AC") then
  442.             if npc.Parent.Name == array.targ then
  443.                 local magnitude = (npc.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude
  444.  
  445.                 if magnitude < nearest then
  446.                     nearestnpc, nearest = npc, magnitude
  447.                 end
  448.             elseif myData.Boss[npc.Name] and tonumber(player.PlayerFolder.Stats.Level.Value) >= array.boss[npc.Name] then
  449.                 return npc
  450.             end
  451.         end
  452.     end
  453.     return nearestnpc
  454. end
  455.  
  456. local function getQuest(typ)
  457.     labels("text", "Moving to quest NPC")
  458.  
  459.     local npc = team == "Ghoul" and workspace.Anteiku.Yoshimura or workspace.CCGBuilding.Yoshitoki
  460.  
  461.     tp(npc.HumanoidRootPart.CFrame)
  462.     invoke(game:GetService("ReplicatedStorage").Remotes.Ally.AllyInfo)
  463.     wait()
  464.     fireclickdetector(npc.TaskIndicator.ClickDetector)
  465.  
  466.     if array.autofarm and not array.died and (npc.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).Magnitude <= 20 then
  467.         if typ then
  468.             labels("text", "Getting quest...")
  469.             invoke(remotes[npc.Name].Task)
  470.             invoke(remotes[npc.Name].Task)
  471.             local quest = waitforobj(player.PlayerFolder.CurrentQuest.Complete, "Aogiri Member")
  472.             labels("Quest", ("%c/%c"):format("0", quest:WaitForChild("Max").Value))
  473.             quest.Changed:Connect(function(change)
  474.                 labels("Quest", ("%c/%c"):format(change, quest.Max.Value))
  475.             end)
  476.         else
  477.             labels("text", "Withdrawing reputation")
  478.             invoke(remotes.ReputationCashOut)
  479.             oldtick = tick()
  480.         end
  481.     end
  482. end
  483.  
  484. local function collect(npc)
  485.     local timer = tick()
  486.     local model = waitforobj(npc, npc.Name.." Corpse", 2)
  487.     local clickpart = waitforobj(model, "ClickPart", 2)
  488.  
  489.     player.Character.HumanoidRootPart.CFrame = clickpart.CFrame * CFrame.new(0,1.7,0)
  490.  
  491.     waitforobj(clickpart, "")
  492.     repeat
  493.         if tick() - timer > 4 then
  494.             break
  495.         end
  496.         player.Character.Humanoid:MoveTo(clickpart.Position)
  497.         wait()
  498.         fireclickdetector(clickpart[""], 1)
  499.     until not model.Parent.Parent or not findobj(model, "ClickPart") or not array.autofarm or player.Character.Humanoid.Health <= 0
  500. end
  501.  
  502. local function pressKey(topress)
  503.     fire(player.Character.Remotes.KeyEvent, key, topress, "Down", player:GetMouse().Hit, nil, workspace.Camera.CFrame)
  504. end
  505.  
  506. player.PlayerFolder.Stats.RC.Changed:Connect(function(value)
  507.     if array.autofarm then
  508.         labels("RC", value - labels.RC.oldval, value)
  509.     end
  510. end)
  511.  
  512. player.PlayerFolder.Stats.Yen.Changed:Connect(function(value)
  513.     if array.autofarm then
  514.         labels("Yen", value - labels.Yen.oldval, value)
  515.     end
  516. end)
  517.  
  518. getconnections(player.Idled)[1]:Disable()
  519.  
  520. get.Players.PlayerAdded:Connect(function(plr)
  521.     if array.kick then
  522.         local splittedarray = console:Get():split("\n")
  523.  
  524.         if not table.find(splittedarray, plr.Name) then
  525.             player:Kick("Player joined, name: "..plr.Name)
  526.         end
  527.     end
  528. end)
  529.  
  530. player.PlayerFolder.Trainers[player.PlayerFolder.Trainers[team.."Trainer"].Value].Progress.Changed:Connect(function(c)
  531.     progress:Set(tonumber(c))
  532. end)
  533.  
  534. coroutine.wrap(function()
  535.     while wait() do
  536.         if tonumber(player.PlayerFolder.Stats.Focus.Value) > 0 then
  537.             if array.weapon then
  538.                 invoke(stat, "Focus", "WeaponAddButton", 1)
  539.             end
  540.             if array.dura then
  541.                 invoke(stat, "Focus", "DurabilityAddButton", 1)
  542.             end
  543.         end
  544.     end
  545. end)()
  546.  
  547. -- remote Key grabber + grab updated trainers table
  548. do
  549.     fireclickdetector(workspace.TrainerModel.ClickIndicator.ClickDetector)
  550.     waitforobj(waitforobj(player.PlayerGui, "TrainersGui"), "TrainersGuiScript")
  551.     player.PlayerGui.TrainersGui:Destroy()
  552.  
  553.     repeat
  554.         for i,v in pairs(getgc(true)) do
  555.             if not key and type(v) == "function" and getinfo(v).source:find(".ClientControl") then
  556.                 for i2,v2 in pairs(getconstants(v)) do
  557.                     if v2 == "KeyEvent" then
  558.                         local keyfound = getconstant(v, i2 + 1)
  559.                         if #keyfound >= 100 then
  560.                             key = keyfound
  561.                             break
  562.                         end
  563.                     end
  564.                 end
  565.             elseif type(v) == "table" and ((table.find(v, "(S1) Kureo Mado") and team == "CCG") or (table.find(v, "(S1) Ken Kaneki"))) then
  566.                 trainers = v
  567.             end
  568.         end
  569.         wait()
  570.     until key
  571. end
  572.  
  573. -- auto farm
  574. while true do
  575.     if array.autofarm then
  576.         pcall(function()
  577.             if player.Character.Humanoid.Health > 0 and player.Character.HumanoidRootPart and player.Character.Remotes.KeyEvent then
  578.                 if not findobj(player.Character, "Kagune") and not findobj(player.Character, "Quinque")  then
  579.                     pressKey(array.stage)
  580.                 end
  581.                 if myData.ReputationFarm and (not findobj(player.PlayerFolder.CurrentQuest.Complete, "Aogiri Member") or player.PlayerFolder.CurrentQuest.Complete["Aogiri Member"].Value == player.PlayerFolder.CurrentQuest.Complete["Aogiri Member"].Max.Value) then
  582.                     getQuest(true)
  583.                     return
  584.                 elseif myData.ReputationCashout and tick() - oldtick > 7200 then
  585.                     getQuest()
  586.                 end
  587.  
  588.                 local npc = getNPC()
  589.  
  590.                 if npc then
  591.                     array.found = false
  592.                     local reached = false
  593.  
  594.                     coroutine.wrap(function()
  595.                         while not reached do
  596.                             if npc ~= getNPC() then
  597.                                 array.found = true
  598.                                 break
  599.                             end
  600.                             wait()
  601.                         end
  602.                     end)()
  603.  
  604.                     labels("text", "Moving to: "..npc.Name)
  605.  
  606.                     if myData.Boss[npc.Name] or npc.Parent.Name == "GyakusatsuSpawn" then
  607.                         tp(npc.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(90),0,0) + Vector3.new(0,myData.DistanceFromBoss,0))
  608.                     else
  609.                         tp(npc.HumanoidRootPart.CFrame + npc.HumanoidRootPart.CFrame.lookVector * myData.DistanceFromNpc)
  610.                     end
  611.  
  612.                     labels("text", "Killing: "..npc.Name)
  613.                    
  614.                     reached = true
  615.  
  616.                     if not array.found then
  617.                         while findobj(findobj(npc.Parent, npc.Name), "Head") and player.Character.Humanoid.Health > 0 and array.autofarm do
  618.                             if not findobj(player.Character, "Kagune") and not findobj(player.Character, "Quinque")  then
  619.                                 pressKey(array.stage)
  620.                             end
  621.                             if myData.Boss[npc.Name] or npc.Parent.Name == "GyakusatsuSpawn" then
  622.                                 for x,y in pairs(myData.Skills) do
  623.                                     if player.PlayerFolder.CanAct.Value and y and array.skills[x].Value ~= "DownTime" then
  624.                                         pressKey(x)
  625.                                     end
  626.                                 end
  627.                                 player.Character.HumanoidRootPart.CFrame = npc.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(90),0,0) + Vector3.new(0,myData.DistanceFromBoss ,0)
  628.                             else
  629.                                 player.Character.HumanoidRootPart.CFrame = npc.HumanoidRootPart.CFrame + npc.HumanoidRootPart.CFrame.lookVector * myData.DistanceFromNpc
  630.                             end
  631.                             if player.PlayerFolder.CanAct.Value then
  632.                                 pressKey("Mouse1")
  633.                             end
  634.                             task.wait()
  635.                         end
  636.  
  637.                         if npc.Name == "Gyakusatsu" then
  638.                             player.Character.Humanoid.Health = 0
  639.                         end
  640.  
  641.                         if array.autofarm and player.Character.Humanoid.Health > 0 then
  642.                             labels("Kills", 1)
  643.                             if npc.Name ~= "Eto Yoshimura" and not findobj(npc.Parent, "Gyakusatsu") and npc.Name ~= "Gyakusatsu" then  
  644.                                 labels("text", "Collecting corpse...")
  645.                                 collect(npc)
  646.                             end
  647.                         end
  648.                     end
  649.                 else
  650.                     labels("text", "Target not found, waiting...")
  651.                 end
  652.             else
  653.                 labels("text", "Waiting for character to respawn")
  654.                 array.died = true
  655.             end
  656.         end)
  657.     else
  658.         labels("text", "")
  659.     end
  660.     wait()
  661. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement